Skip to content

Commit cb4b4c1

Browse files
committed
fix(docker): Wait for 60s before switching to another server.
1 parent 093b96c commit cb4b4c1

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

dockerfiles/agent-discovery/find-name.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,16 @@ while true; do
7979
sleep 2 # Wait for 5 seconds before the next iteration of the loop.
8080
done
8181

82-
# Check if jenkins_controller is reachable, otherwise fall back to multi_jenkins_controller
82+
## Check if jenkins_controller is reachable, otherwise fall back to multi_jenkins_controller
8383
JENKINS_CONTROLLER="jenkins_controller"
84-
if ! curl -s -f "http://${JENKINS_CONTROLLER}:8080/login" > /dev/null; then
84+
if ! curl -s -f --max-time 60 "http://${JENKINS_CONTROLLER}:8080/login" > /dev/null; then
8585
echo "Primary controller not reachable, falling back to multi controller..."
86-
JENKINS_CONTROLLER="multi_jenkins_controller"
87-
if ! curl -s -f "http://${JENKINS_CONTROLLER}:8080/login" > /dev/null; then
88-
echo "Error: Neither primary nor multi controller is reachable"
89-
exit 1
86+
JENKINS_CONTROLLER="multi_jenkins_controller"
87+
if ! curl -s -f --max-time 60 "http://${JENKINS_CONTROLLER}:8080/login" > /dev/null; then
88+
echo "Error: Neither primary nor multi controller is reachable"
89+
exit 1
9090
fi
91-
fi
91+
fi
9292

9393
# Check If Jenkins is running or not
9494
# If the message is found, awk exits with a non-zero status (1), and the loop continues.

0 commit comments

Comments
 (0)