1
0
Fork 0
mirror of https://github.com/evilhero/mylar synced 2024-12-22 15:52:47 +00:00

FIX: Fix for schedulers displaying None for Next Runs on startup

This commit is contained in:
evilhero 2017-09-11 02:09:18 -04:00
parent ddd06382a4
commit dd750f7cfc
2 changed files with 4 additions and 5 deletions

View file

@ -23,11 +23,10 @@ from mylar import logger, helpers
class dbUpdate():
def __init__(self, sched):
self.sched = sched
pass
def run(self):
def run(self, sched):
logger.info('[DBUpdate] Updating Database.')
helpers.job_management(write=True, job='DB Updater', current_run=helpers.utctimestamp(), status='Running')
mylar.updater.dbUpdate(sched=self.sched)
mylar.updater.dbUpdate(sched=sched)
helpers.job_management(write=True, job='DB Updater', last_run_completed=helpers.utctimestamp(), status='Waiting')

View file

@ -2218,7 +2218,7 @@ class WebInterface(object):
prev_run = datetime.datetime.fromtimestamp(pr)
else:
prev_run = None
if jb['prev_run_datetime'] is not None:
if jb['next_run_datetime'] is not None:
try:
nr = (datetime.datetime.strptime(jb['next_run_datetime'][:19], '%Y-%m-%d %H:%M:%S') - datetime.datetime.utcfromtimestamp(0)).total_seconds()
except ValueError:
@ -2299,7 +2299,7 @@ class WebInterface(object):
elif jobid == 'version':
mylar.SCHED.add_job(func=jb.func, trigger=DateTrigger(run_date=datetime.datetime.now()))
elif jobid == 'updater':
mylar.SCHED.add_job(func=jb.func, trigger=DateTrigger(run_date=datetime.datetime.now()))
mylar.SCHED.add_job(func=jb.func, args=[None,None,True], trigger=DateTrigger(run_date=datetime.datetime.now()))
elif jobid == 'monitor':
mylar.SCHED.add_job(func=jb.func, trigger=DateTrigger(run_date=datetime.datetime.now()))
break