Skip to content

Commit fa55a8a

Browse files
author
Jeny Sadadia
committed
src/scheduler: schedule a job retry
Get `retry_counter` information from the event a schedule a job retry. Signed-off-by: Jeny Sadadia <[email protected]>
1 parent 4a47f84 commit fa55a8a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/scheduler.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,11 @@ def backup_job(self, filename, nodeid):
144144
except Exception as e:
145145
self.log.error(f"Failed to backup {filename} to {new_filename}: {e}")
146146

147-
def _run_job(self, job_config, runtime, platform, input_node):
147+
def _run_job(self, job_config, runtime, platform, input_node, retry_counter):
148148
try:
149149
node = self._api_helper.create_job_node(job_config,
150150
input_node,
151-
runtime, platform)
151+
runtime, platform, retry_counter)
152152
except KeyError as e:
153153
self.log.error(' '.join([
154154
input_node['id'],
@@ -407,7 +407,8 @@ def _run(self, sub_id):
407407
if not self._verify_architecture_filter(job, input_node):
408408
continue
409409
if self._api_helper.should_create_node(rules, input_node):
410-
self._run_job(job, runtime, platform, input_node)
410+
retry_counter = event.get('retry_counter', 0)
411+
self._run_job(job, runtime, platform, input_node, retry_counter)
411412

412413
return True
413414

0 commit comments

Comments
 (0)