Skip to content

Commit

Permalink
Explicitly clear the revoked flag on task instances after execution.
Browse files Browse the repository at this point in the history
This should fix #713
  • Loading branch information
coleifer committed Feb 24, 2023
1 parent bc922ee commit 026a5ac
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions huey/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,11 @@ def _execute(self, task, timestamp):
else:
logger.info('%s executed in %0.3fs', task, duration)

# Clear the flag if this instance of the task was revoked after it
# began executing by destructively reading it's revoke key.
if not isinstance(task, PeriodicTask):
self.get(task.revoke_id)

if self.results and not isinstance(task, PeriodicTask):
if exception is not None:
error_data = self.build_error_result(task, exception)
Expand Down

0 comments on commit 026a5ac

Please sign in to comment.