Skip to content

Commit

Permalink
Increase the Orchestrator timer, and add a jitter (#1615)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshk authored Oct 28, 2024
1 parent d9b6d39 commit a46a73e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/nerves_hub/deployments/orchestrator.ex
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,9 @@ defmodule NervesHub.Deployments.Orchestrator do
def handle_continue(:boot, deployment) do
_ = PubSub.subscribe(NervesHub.PubSub, "deployment:#{deployment.id}")

# trigger every 5 minutes as a back up
_ = :timer.send_interval(5 * 60 * 1000, :trigger)
# trigger every 10 minutes, plus a jitter between 1 and 5 seconds, as a back up
interval = (10 + :rand.uniform(10)) * 60 * 1000
_ = :timer.send_interval(interval, :trigger)

deployment =
deployment
Expand Down

0 comments on commit a46a73e

Please sign in to comment.