From bd2aa88f07ef9a9d8f308249ca9bc0794138c395 Mon Sep 17 00:00:00 2001 From: Filipe Santos Date: Mon, 23 Apr 2018 15:08:51 +1200 Subject: [PATCH] Prevent negative sleeps in auto run --- traktarr.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/traktarr.py b/traktarr.py index dba5b8e..bfd5d0b 100755 --- a/traktarr.py +++ b/traktarr.py @@ -517,12 +517,13 @@ def run(add_delay=2.5, no_search=False, no_notifications=False): try: # Sleep until 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 schedule.run_pending() except Exception as e: log.exception("Unhandled exception occurred while processing scheduled tasks: %s", e) + time.sleep(1) ############################################################