Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

Commit

Permalink
caddy-lb-policy-switch: Add sleep to their proper places
Browse files Browse the repository at this point in the history
  • Loading branch information
kreatoo committed Jun 13, 2024
1 parent 601ae90 commit 6563353
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions caddy/caddy-lb-policy-switch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
start="$(date +%s)"

if [[ "$1" == "--version" ]] || [[ "$1" == "-v" ]]; then
echo "v0.5.0"
echo "v1.0.0"
exit 0
fi

Expand Down Expand Up @@ -233,7 +233,6 @@ function change_upstreams() {

mkdir -p /tmp/glb/"$URL_TO_FIND"/"$IDENTIFIER"
echo "$1" > /tmp/glb/"$URL_TO_FIND"/"$IDENTIFIER"/lb_policy
sleep "${LB_POLICY_CHANGE_SLEEP:-1}"
}

function adjust_api_urls() {
Expand Down Expand Up @@ -327,6 +326,7 @@ function main() {
identify_request "$1" "$2"
echo '---------------------------------'
done
sleep "${LB_POLICY_CHANGE_SLEEP:-1}"
done
else
for URL_UP in "${CADDY_API_URLS_NEW[@]}"; do
Expand All @@ -336,6 +336,7 @@ function main() {
echo '---------------------------------'
echo "Checking '$URL_TO_FIND' on '$URL'"
identify_request "$1" "$2"
sleep "${LB_POLICY_CHANGE_SLEEP:-1}"
echo '---------------------------------'
done
done
Expand Down

0 comments on commit 6563353

Please sign in to comment.