workers: Pass down if they are running multi-threaded.

This allows them to decide for themselves if they should enable
timeouts.
This commit is contained in:
Alex Vandiver
2023-05-16 14:57:35 +00:00
committed by Tim Abbott
parent 5329fed387
commit 9f231322c9
4 changed files with 16 additions and 16 deletions

View File

@@ -107,7 +107,6 @@ class Command(BaseCommand):
signal.signal(signal.SIGTERM, signal_handler)
signal.signal(signal.SIGINT, signal_handler)
signal.signal(signal.SIGUSR1, signal_handler)
worker.ENABLE_TIMEOUTS = True
worker.start()
@@ -118,7 +117,7 @@ class ThreadedWorker(threading.Thread):
self.queue_name = queue_name
with log_and_exit_if_exception(logger, queue_name, threaded=True):
self.worker = get_worker(queue_name)
self.worker = get_worker(queue_name, threaded=True)
def run(self) -> None:
with configure_scope() as scope, log_and_exit_if_exception(