just use python time calls for jobs, now db and python calls, as on Cams box, this can results in the last update (Cams box) occurring before the job is created in the db (maras time) - and that shows up as negative durations
This commit is contained in:
@@ -227,10 +227,11 @@ def ProcessImportDirs(parent_job=None):
|
||||
if settings == None:
|
||||
raise Exception("Cannot create file data with no settings / import path is missing")
|
||||
paths = settings.import_path.split("#")
|
||||
now=datetime.now(pytz.utc)
|
||||
for path in paths:
|
||||
# make new Job; HandleJobs will make them run later
|
||||
jex=JobExtra( name="path", value=path )
|
||||
job=Job(start_time='now()', last_update='now()', name="importdir", state="New", wait_for=None, pa_job_state="New", current_file_num=0, num_files=0 )
|
||||
job=Job(start_time=now, last_update=now, name="importdir", state="New", wait_for=None, pa_job_state="New", current_file_num=0, num_files=0 )
|
||||
job.extra.append(jex)
|
||||
session.add(job)
|
||||
session.commit()
|
||||
@@ -239,14 +240,14 @@ def ProcessImportDirs(parent_job=None):
|
||||
# force commit to make job.id be valid in use of wait_for later
|
||||
session.commit()
|
||||
jex2=JobExtra( name="path", value=path )
|
||||
job2=Job(start_time='now()', last_update='now()', name="getfiledetails", state="New", wait_for=job.id, pa_job_state="New", current_file_num=0 )
|
||||
job2=Job(start_time=now, last_update=now, name="getfiledetails", state="New", wait_for=job.id, pa_job_state="New", current_file_num=0 )
|
||||
job2.extra.append(jex2)
|
||||
session.add(job2)
|
||||
session.commit()
|
||||
if parent_job:
|
||||
AddLogForJob(parent_job, "adding <a href='/job/{}'>job id={} {}</a> (wait for: {})".format( job2.id, job2.id, job2.name, job2.wait_for ) )
|
||||
jex3=JobExtra( name="path", value=path )
|
||||
job3=Job(start_time='now()', last_update='now()', name="processai", state="New", wait_for=job2.id, pa_job_state="New", current_file_num=0 )
|
||||
job3=Job(start_time=now, last_update=now, name="processai", state="New", wait_for=job2.id, pa_job_state="New", current_file_num=0 )
|
||||
job3.extra.append(jex3)
|
||||
session.add(job3)
|
||||
session.commit()
|
||||
|
||||
Reference in New Issue
Block a user