Skip to content

Commit

Permalink
Add sleep between runner startups
Browse files Browse the repository at this point in the history
  • Loading branch information
efrecon committed Feb 12, 2024
1 parent 57db011 commit cd100ca
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions orchestrator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ ORCHESTRATOR_DIR=${ORCHESTRATOR_DIR:-""}
# used.
ORCHESTRATOR_ISOLATION=${ORCHESTRATOR_ISOLATION:-"1"}

# Number of seconds to sleep between microVM creation at start
ORCHESTRATOR_SLEEP=${ORCHESTRATOR_SLEEP:-"30"}

# GitHub host, e.g. github.com or github.example.com
RUNNER_GITHUB=${RUNNER_GITHUB:-"github.com"}

Expand Down Expand Up @@ -241,6 +244,12 @@ for i in $(seq 1 "$runners"); do
-E "${ORCHESTRATOR_ENVIRONMENT:-}" \
-- "$i" &
set -- "$@" "$!"
if [ "$i" -lt "$runners" ]; then
if [ -n "$ORCHESTRATOR_SLEEP" ] && [ "$ORCHESTRATOR_SLEEP" -gt 0 ]; then
debug "Sleeping for $ORCHESTRATOR_SLEEP seconds"
sleep "$ORCHESTRATOR_SLEEP"
fi
fi
fi
done

Expand Down

0 comments on commit cd100ca

Please sign in to comment.