Skip to content

Commit 37ea28d

Browse files
authored
Merge pull request #255 from lzaoral/worker-do-not-accept-new-tasks-when-locked
worker: do not open additional tasks if the `TaskManager` is locked
2 parents d245e0c + bc1095f commit 37ea28d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

kobo/worker/taskmanager.py

+4
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,10 @@ def get_next_task(self):
313313

314314
# process tasks that could be transitioned to the OPEN state
315315
for task_info in tasks_to_open:
316+
# do not take additional tasks
317+
if self.locked:
318+
return
319+
316320
self.take_task(task_info)
317321

318322
def take_task(self, task_info):

0 commit comments

Comments
 (0)