Skip to content

Commit

Permalink
Add a comment regarding using job queue for checking for updates
Browse files Browse the repository at this point in the history
I removed it more than once, then remembered why it's the way that it is.
  • Loading branch information
Electronic-Mango committed Jun 18, 2024
1 parent 946c965 commit e3b8f67
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/bot/update_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ async def _delayed_check_for_all_updates(context: ContextTypes.DEFAULT_TYPE) ->
logger.info("Starting checking for all updates")
delay = 0
for feed_data in get_all_stored_data():
# Checking for updates for feeds is done through a job queue so that async exceptions
# won't stop entire procedure.
context.job_queue.run_once(callback=_check_for_updates, when=delay, data=feed_data)
delay += LOOKUP_FEED_DELAY
delay += randrange(max(LOOKUP_FEED_DELAY_RANDOMNESS, 1)) # randrange(1) always returns 0
Expand Down

0 comments on commit e3b8f67

Please sign in to comment.