From f253760d267cbbd01e7fc3d1deba87627e06ab62 Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Sat, 23 Jan 2021 20:19:44 +1100 Subject: [PATCH] update start time of jobs to when they actually are starting to run, should also help with durations being more accurate. Also added a catch-all force job finish if one is not done already. Will stop it enetering an endless loop --- pa_job_manager.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pa_job_manager.py b/pa_job_manager.py index 37fb947..27c9e09 100644 --- a/pa_job_manager.py +++ b/pa_job_manager.py @@ -271,6 +271,7 @@ def AddLogForJob(job, message, current_file=''): def RunJob(job): # session = Session() + job.start_time=datetime.now(pytz.utc) if job.name =="scannow": JobScanNow(job) elif job.name =="forcescan": @@ -285,6 +286,8 @@ def RunJob(job): print("ERROR: Requested to process unknown job type: {}".format(job.name)) # okay, we finished a job, so check for any jobs that are dependant on this and run them... # session.close() + if job.pa_job_state != "Completed": + FinishJob(job, "PA Job Manager - This is a catchall to close of a Job, this sould never be seen and implies a job did not complete formally?", "Failed" ) HandleJobs() return