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

This commit is contained in:
2021-01-23 20:19:44 +11:00
parent e17d6c41fe
commit f253760d26

View File

@@ -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