Skip to content

Commit

Permalink
fix: race condition when acknowledging task
Browse files Browse the repository at this point in the history
  • Loading branch information
ClemDoum committed Jun 12, 2024
1 parent a263340 commit c838b6b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion icij-worker/icij_worker/worker/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ async def acknowledge(self, task: Task):
completed_at = datetime.now()
self.info('Task(id="%s") acknowledging...', task.id)
await self._acknowledge(task, completed_at)
self._current = None
self.info('Task(id="%s") acknowledged', task.id)
self.debug('Task(id="%s") publishing acknowledgement event', task.id)
task_event = TaskEvent(
Expand All @@ -261,7 +262,6 @@ async def acknowledge(self, task: Task):
# Tell the listeners that the task succeeded
await self.publish_event(event, task)
self.info('Task(id="%s") successful !', task.id)
self._current = None

@abstractmethod
async def _acknowledge(self, task: Task, completed_at: datetime) -> Task: ...
Expand Down

0 comments on commit c838b6b

Please sign in to comment.