Skip to content

Commit

Permalink
bugfix: do not start additional runners if current runner count is ab…
Browse files Browse the repository at this point in the history
…ove expected count
  • Loading branch information
gr0vity-dev committed Dec 21, 2022
1 parent 99700d6 commit 8b8a572
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion respawn
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ SCOPE="repos"

#TODO: ALERT if lxc command fails meaning lxd servcie is down
CURRENT_RUNNER_COUNT=$(lxc ls | grep github-.*RUNNING.*EPHEMERAL | wc -l)
if [ $((( $SPAWN_COUNT - $CURRENT_RUNNER_COUNT ))) -eq 0 ]
if [ $((( $SPAWN_COUNT - $CURRENT_RUNNER_COUNT ))) -le 0 ]
then
exit 0
else
SPAWN_COUNT=$((($SPAWN_COUNT - $CURRENT_RUNNER_COUNT)))
fi

exit 0


# This is done outside the scope of the LXD container because exporting variables is not working as expected
_PROTO="$(echo "${RUNNER_URL}" | grep :// | sed -e's,^\(.*://\).*,\1,g')"
Expand Down

0 comments on commit 8b8a572

Please sign in to comment.