job creation no longer checks for already existing/same jobs
This commit is contained in:
@@ -50,11 +50,15 @@ class JobManager:
|
|||||||
# 4 = izlusci async glede na vhodne conlluje
|
# 4 = izlusci async glede na vhodne conlluje
|
||||||
# 5 = izlusci po iskanju async
|
# 5 = izlusci po iskanju async
|
||||||
|
|
||||||
|
# 0 = Not settable here, but if a job has the type 0, then it was *deleted*
|
||||||
|
|
||||||
:return: Job object, Did already exist boolean
|
:return: Job object, Did already exist boolean
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
|
is_new = False # caching disabled for now...
|
||||||
if job_type in [2, 4, 5]:
|
if job_type in [2, 4, 5]:
|
||||||
job, is_new = Job.get_or_create(job_type=job_type, job_input=job_input, input_size=len(job_input))
|
# job, is_new = Job.get_or_create(job_type=job_type, job_input=job_input, input_size=len(job_input))
|
||||||
|
job = Job.create(job_type=job_type, job_input=job_input, input_size=len(job_input))
|
||||||
elif job_type in [1, 3, 12, 32]:
|
elif job_type in [1, 3, 12, 32]:
|
||||||
tmp_file = ""
|
tmp_file = ""
|
||||||
while True:
|
while True:
|
||||||
@@ -65,8 +69,10 @@ class JobManager:
|
|||||||
pathlib.Path('tmp').mkdir(exist_ok=True)
|
pathlib.Path('tmp').mkdir(exist_ok=True)
|
||||||
job_input: werkzeug.datastructures.FileStorage
|
job_input: werkzeug.datastructures.FileStorage
|
||||||
job_input.save(tmp_file)
|
job_input.save(tmp_file)
|
||||||
job, is_new = Job.get_or_create(job_type=job_type, input_file=tmp_file,
|
# job, is_new = Job.get_or_create(job_type=job_type, input_file=tmp_file,
|
||||||
input_size=os.stat(tmp_file).st_size)
|
# input_size=os.stat(tmp_file).st_size)
|
||||||
|
job = Job.create(job_type=job_type, input_file=tmp_file,
|
||||||
|
input_size=os.stat(tmp_file).st_size)
|
||||||
return job, is_new
|
return job, is_new
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
Reference in New Issue
Block a user