use job id for swarm run instead of job object

This commit is contained in:
Patrick Jentsch
2019-08-11 19:01:19 +02:00
parent a302d08405
commit ad8a8a4696
2 changed files with 8 additions and 7 deletions

View File

@ -48,8 +48,7 @@ def nlp():
' NOTE: Using self created threads is just for testing purpose as
' there is no scheduler available.
'''
db.session.expunge(nlp_job)
thread = Thread(target=swarm.run, args=(nlp_job,))
thread = Thread(target=swarm.run, args=(nlp_job.id,))
thread.start()
flash('Job created!')
return redirect(url_for('services.nlp'))
@ -101,8 +100,7 @@ def ocr():
' NOTE: Using self created threads is just for testing purpose as
' there is no scheduler available.
'''
db.session.expunge(ocr_job)
thread = Thread(target=swarm.run, args=(ocr_job,))
thread = Thread(target=swarm.run, args=(ocr_job.id,))
thread.start()
flash('Job created!')
return redirect(url_for('services.ocr'))