diff --git a/lazylibrarian/common.py b/lazylibrarian/common.py index 6c3586eb5..9210d1365 100644 --- a/lazylibrarian/common.py +++ b/lazylibrarian/common.py @@ -478,7 +478,8 @@ def scheduleJob(action='Start', target=None): if not authcount: minutes = 60 else: - minutes = int(minutes / authcount) + # Allow a few minutes per task - interval starts from END of previous task + minutes = int(minutes / authcount) - 5 if minutes < 10: # set a minimum interval of 10 minutes so we don't upset goodreads/librarything api minutes = 10 @@ -633,7 +634,7 @@ def showJobs(): jobname = job.split(' ')[0].split('.')[2] # jobinterval = job.split('[')[1].split(']')[0] - jobtime = job.split('at: ')[1].split('.')[0] + jobtime = job.split('at: ')[1].split('.')[0].strip(')') jobtime = next_run(jobtime) timeparts = jobtime.split(' ') if timeparts[0] == '1' and timeparts[1].endswith('s'): diff --git a/lazylibrarian/formatter.py b/lazylibrarian/formatter.py index bae1d4612..7986fdfbb 100644 --- a/lazylibrarian/formatter.py +++ b/lazylibrarian/formatter.py @@ -110,8 +110,10 @@ def next_run(when_run): timenow = datetime.datetime.now() td = when_run - timenow diff = td.seconds # time difference in seconds - except ValueError: + except ValueError as e: + logger.error("Error getting next run for [%s] %s" % (when_run, str(e))) diff = 0 + # calculate whole units, plus round up by adding 1(true) if remainder >= half days = int(diff / 86400) + (diff % 86400 >= 43200) hours = int(diff / 3600) + (diff % 3600 >= 1800)