refactor(package): sentinella: +logging

This commit is contained in:
2025-10-25 09:54:57 +00:00
parent af5d46b3f0
commit 39abe553f5
3 changed files with 7 additions and 2 deletions

View File

@@ -51,6 +51,7 @@ route_status() {
tot=$((tot+1))
res=$(curl -sS -m "$TIMEOUT" -o /dev/null -w '%{http_code} %{time_total}' "$u" 2>/dev/null) || res="000 0"
code=${res%% *}; ttot=${res#* }
log info "$u -> $code"
case $code in 2*|3*) ok=true; okcnt=$((okcnt+1));; *) ok=false;; esac
[ $first -eq 0 ] && printf ','; first=0
printf '{"url":"%s","code":%s,"time_s":%s,"ok":%s}' "$u" "$code" "$ttot" "$ok"