From ddbf1903c24fd1b0a8a2f0316ded16093ba3c873 Mon Sep 17 00:00:00 2001 From: Filipe Santos Date: Sun, 6 May 2018 15:30:42 +1200 Subject: [PATCH] Negative int is True, avoid negative sleeps --- traktarr.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/traktarr.py b/traktarr.py index d0f2049..284bc31 100755 --- a/traktarr.py +++ b/traktarr.py @@ -733,7 +733,7 @@ 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() or 0) + time.sleep(max(schedule.idle_seconds(), 0)) # Check jobs to run schedule.run_pending() @@ -764,13 +764,13 @@ def init_notifications(): if __name__ == "__main__": print(""" - - ,--. ,--. ,--. -,-' '-.,--.--. ,--,--.| |,-.,-' '-. ,--,--.,--.--.,--.--. -'-. .-'| .--'' ,-. || /'-. .-'' ,-. || .--'| .--' - | | | | \ '-' || \ \ | | \ '-' || | | | - `--' `--' `--`--'`--'`--' `--' `--`--'`--' `--' - + + ,--. ,--. ,--. +,-' '-.,--.--. ,--,--.| |,-.,-' '-. ,--,--.,--.--.,--.--. +'-. .-'| .--'' ,-. || /'-. .-'' ,-. || .--'| .--' + | | | | \ '-' || \ \ | | \ '-' || | | | + `--' `--' `--`--'`--'`--' `--' `--`--'`--' `--' + ######################################################################### # Author: l3uddz # # URL: https://github.com/l3uddz/traktarr #