Skip to content

Commit be3b50d

Browse files
iberryfulib-steffen
authored andcommitted
Avoid generating duplicate jobs. Fix #227 (#232)
1 parent 3095515 commit be3b50d

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/api/handlers/projects/jobs.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ def get(self, project_id, job_id):
232232
abort(400, 'This job has been already restarted')
233233

234234
jobs = g.db.execute_many_dict('''
235-
SELECT state, id, dependencies
235+
SELECT state, id, dependencies, restarted
236236
FROM job
237237
WHERE build_id = %s
238238
AND project_id = %s
@@ -249,6 +249,10 @@ def get(self, project_id, job_id):
249249
if not j['dependencies']:
250250
continue
251251

252+
#Avoid generating duplicate jobs. Fix #227(https://github.com/SAP/InfraBox/issues/227)
253+
if j['restarted']:
254+
continue
255+
252256
for dep in j['dependencies']:
253257
dep_id = dep['job-id']
254258

0 commit comments

Comments
 (0)