From 33319f00d1348fa1c1b582eaeadf49bd4dfd0544 Mon Sep 17 00:00:00 2001 From: Ran Lu Date: Sat, 13 Jul 2024 20:44:52 -0400 Subject: [PATCH] Add 5s delay before launching a new task Help avoid overwhelming services and thrashing our system --- custom/task_execution.py | 1 + 1 file changed, 1 insertion(+) diff --git a/custom/task_execution.py b/custom/task_execution.py index 4f0ef8c9..d2e47026 100644 --- a/custom/task_execution.py +++ b/custom/task_execution.py @@ -129,6 +129,7 @@ def execute(qurl, timeout, queue_name, statsd, max_concurrency): future = executor.submit(handle_task, message.payload, statsd) running_tasks.append(CustomTask(message, future)) concurrency = update_concurrency(running_tasks, max_concurrency) + time.sleep(5) except SimpleQueue.Empty: pass