Skip to content

Commit

Permalink
Reboot worker periodically (#1744)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalybuka committed Apr 16, 2024
1 parent 61321df commit 7a3ea2d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions buildbot/start_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,17 @@ function is_worker_connected() {
)
}

function shutdown_maybe() {
[[ $(cat /proc/uptime | grep -oP "^\d+") -lt $((3600*72)) ]] && return
(w -h | wc -l) && return
while sudo pkill -SIGHUP buildbot-worker; do sleep 5; done;
shutdown now
sleep 1000
}

function get_worker_host() {
local WORKER_NAME="$1"
shutdown_maybe
(
set -o pipefail
curl ${API_URL}/${WORKER_NAME} \
Expand Down

0 comments on commit 7a3ea2d

Please sign in to comment.