Skip to content

Commit

Permalink
feat(scraper): distribute sleeps properly.
Browse files Browse the repository at this point in the history
  • Loading branch information
2e0byo committed Jan 29, 2022
1 parent 6873228 commit 7402f4f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions yadc/scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,12 +435,12 @@ def __call__(self):
self.find_tests(browser, driver)
end = datetime.now()
period = self.time_to_next_event(elapsed=end - start)
self._logger.debug(f"Sleeping for {period}")
spinner_sleep(period)
period = max(period - 5, 0)
self._logger.debug(f"Sleeping for {period}s.")
self._logger.debug(
f"Sleeping for ~10s to introduce some randomness."
f"Sleeping for ~5s to introduce some randomness."
)
randsleep(10)
randsleep(5)
except Exception as e:
errs.append(monotonic())
self._logger.exception(e)
Expand Down

0 comments on commit 7402f4f

Please # to comment.