Skip to content

Commit 4f12f17

Browse files
authored
Merge branch 'resuming-progress' of 'https://github.com/jjmerchante/grimoirelab-core'
Merges #37 Closes #37
2 parents 5fcdd42 + eb777ff commit 4f12f17

File tree

1 file changed

+5
-2
lines changed
  • src/grimoirelab/core/scheduler/tasks

1 file changed

+5
-2
lines changed

src/grimoirelab/core/scheduler/tasks/models.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,11 @@ def prepare_job_parameters(self):
131131
job_args = args_gen.initial_args(self.task_args)
132132
elif self.status == SchedulerStatus.COMPLETED:
133133
job = self.jobs.all().order_by('-job_num').first()
134-
progress = ChroniclerProgress.from_dict(job.progress)
135-
job_args = args_gen.resuming_args(job.job_args['job_args'], progress)
134+
if job and job.progress:
135+
progress = ChroniclerProgress.from_dict(job.progress)
136+
job_args = args_gen.resuming_args(job.job_args['job_args'], progress)
137+
else:
138+
job_args = args_gen.initial_args(self.task_args)
136139
elif self.status == SchedulerStatus.RECOVERY:
137140
job = self.jobs.all().order_by('-job_num').first()
138141
if job and job.progress:

0 commit comments

Comments
 (0)