Skip to content

Commit

Permalink
Merge pull request #255 from lzaoral/worker-do-not-accept-new-tasks-w…
Browse files Browse the repository at this point in the history
…hen-locked

worker: do not open additional tasks if the `TaskManager` is locked
  • Loading branch information
rohanpm authored Mar 25, 2024
2 parents d245e0c + bc1095f commit 37ea28d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions kobo/worker/taskmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,10 @@ def get_next_task(self):

# process tasks that could be transitioned to the OPEN state
for task_info in tasks_to_open:
# do not take additional tasks
if self.locked:
return

self.take_task(task_info)

def take_task(self, task_info):
Expand Down

0 comments on commit 37ea28d

Please sign in to comment.