Prevent negative sleeps in auto run

pull/18/head
Filipe Santos 7 years ago
parent f061a1651a
commit 657fb9613b
No known key found for this signature in database
GPG Key ID: 76BB130DA5573A4E

@ -517,12 +517,13 @@ def run(add_delay=2.5, no_search=False, no_notifications=False):
try: try:
# Sleep until next run # Sleep until next run
log.info("Next job at %s", schedule.next_run()) log.info("Next job at %s", schedule.next_run())
time.sleep(schedule.idle_seconds()) time.sleep(schedule.idle_seconds() or 0)
# Check jobs to run # Check jobs to run
schedule.run_pending() schedule.run_pending()
except Exception as e: except Exception as e:
log.exception("Unhandled exception occurred while processing scheduled tasks: %s", e) log.exception("Unhandled exception occurred while processing scheduled tasks: %s", e)
time.sleep(1)
############################################################ ############################################################

Loading…
Cancel
Save