allow NewJob to have job extras added

This commit is contained in:
2021-02-14 16:02:41 +11:00
parent 09d56c5cc5
commit d9a94ff5da

6
job.py
View File

@@ -73,10 +73,14 @@ def WakePAJobManager():
# NewJob takes a name (which will be matched in pa_job_manager.py to run
# the appropriate job - which will update the Job() until complete
###############################################################################
def NewJob(name, num_files="0", wait_for=None ):
def NewJob(name, num_files="0", wait_for=None, jex=None ):
job=Job(start_time='now()', last_update='now()', name=name, state="New", num_files=num_files,
current_file_num=0, current_file='',
wait_for=wait_for, pa_job_state="New" )
if jex != None:
for e in jex:
job.extra.append(e)
db.session.add(job)
db.session.commit()