fix: treat 524/504 timeout as accepted on repull

This commit is contained in:
2026-04-23 14:28:26 +08:00
parent 3e9fbacd94
commit 4f870a5c16

View File

@@ -48,9 +48,11 @@ HTTP_STATUS=$(curl -s -o /tmp/portainer_response.json -w "%{http_code}" \
-H "Content-Type: application/json" \
-d "$PAYLOAD")
if [ "$HTTP_STATUS" != "200" ]; then
if [ "$HTTP_STATUS" = "524" ] || [ "$HTTP_STATUS" = "504" ] || [ "$HTTP_STATUS" = "408" ]; then
echo "⚠️ HTTP $HTTP_STATUS (gateway timeout) — Portainer tetap memproses redeploy, lanjut polling container..."
elif [ "$HTTP_STATUS" != "200" ]; then
echo "❌ Redeploy gagal! HTTP Status: $HTTP_STATUS"
cat /tmp/portainer_response.json | jq .
cat /tmp/portainer_response.json | jq . 2>/dev/null || true
exit 1
fi