Skip to content

Commit

Permalink
Adds ultimate error handling to get_compound_htmls
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanChernyshov committed Sep 23, 2024
1 parent 4fafe14 commit 9f3c732
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions update/get_compound_htmls.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,11 @@ def download_compound_htmls(df: pd.core.frame.DataFrame, dir_html: str,
download_compound_html(url, path_html, path_err)
n_errs = 0
time.sleep(crawl_delay)
except TimeoutError:
except (KeyboardInterrupt, SystemError, SystemExit):
raise
except:
n_errs += 1
time.sleep(max(30, 10*crawl_delay))
time.sleep(max(120, 10*crawl_delay))

return

Expand Down

0 comments on commit 9f3c732

Please sign in to comment.