Skip to content

Commit 4b17051

Browse files
committed
Submit the job on commit
1 parent c2086b7 commit 4b17051

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

qiita_db/analysis.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,9 @@ def create(cls, owner, name, description, from_default=False,
184184
qdb.sql_connection.TRN.add(sql, [a_id, job.id])
185185
qdb.sql_connection.TRN.execute()
186186

187-
# Doing the submission outside of the transaction
188-
job.submit()
187+
# Don't submit the job until the transaction commits
188+
qdb.sql_connection.TRN.add_post_commit_func(job.submit)
189+
189190
return instance
190191

191192
@classmethod

0 commit comments

Comments
 (0)