Skip to content

Commit

Permalink
Add 5s delay before launching a new task
Browse files Browse the repository at this point in the history
Help avoid overwhelming services and thrashing our system
  • Loading branch information
ranlu committed Jul 14, 2024
1 parent 477593b commit 33319f0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions custom/task_execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 33319f0

Please sign in to comment.