Skip to content

Commit

Permalink
Run periodic tasks before handling tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
stchris committed May 24, 2024
1 parent 799c0b8 commit e2cd6fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion servicelayer/taskqueue.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,7 @@ def process_blocking(self):
"""Blocking worker thread - executes tasks from a queue and periodic tasks"""
while True:
try:
self.periodic()
(task, channel, connection) = self.local_queue.get(timeout=TIMEOUT)
apply_task_context(task, v=self.version)
self.handle(task)
Expand All @@ -420,7 +421,6 @@ def process_blocking(self):
pass
finally:
clear_contextvars()
self.periodic()

def process_nonblocking(self):
"""Non-blocking worker is used for tests only."""
Expand Down

0 comments on commit e2cd6fb

Please sign in to comment.