Since you're not using the estimated_time in the new version, let's completely remove those lines in _run_bootstrap_jobs():
estimated_time = 0
for job_id in jobs_to_run:
job = self.sa.get_job(job_id)
if (job.estimated_duration is not None and estimated_time is not None): estimated_time += job.estimated_duration
else: estimated_time = None
[...]
if (job.estimated_duration is not None and estimated_time is not None): estimated_time -= job.estimated_duration
Since you're not using the estimated_time in the new version, let's completely remove those lines in _run_bootstrap_ jobs():
for job_id in jobs_to_run:
job = self.sa.
if (job.estimated_
else:
[...]
if (job.estimated_ duration is not None and
estimated _time is not None):
estimated_ time -= job.estimated_ duration