)
self._exit_flag = True
return
del self._run_threads[job.run_id]
if self._count and self._count == count:
logger.debug("Exiting main loop because max count reached.")
self._exit_flag = True
return
After Change
waiting = False
count += 1
run_id = job.run_id
if self._run_status[run_id] == RunStatus.STOPPED:
continue
logger.debug("Spawning new thread for run {}.".format(run_id))
thread = threading.Thread(target=self._run_job, args=(job,))
self._run_threads[run_id] = thread
thread.start()