fix(cd): retry public health curl timeout
All checks were successful
Code Review / ai-code-review (push) Successful in 12s

This commit is contained in:
Your Name
2026-06-01 18:32:03 +08:00
parent 3777a26f73
commit 9c62e4448c
2 changed files with 23 additions and 1 deletions

View File

@@ -1052,7 +1052,13 @@ jobs:
# Health Check
HEALTH_PASS=0
for i in 1 2 3; do
HTTP_CODE=$(curl -s -w "%{http_code}" -o /dev/null --connect-timeout 10 --max-time 12 "${{ env.API_HEALTH_URL }}")
set +e
HTTP_CODE=$(curl -sS -w "%{http_code}" -o /dev/null --connect-timeout 10 --max-time 20 "${{ env.API_HEALTH_URL }}" 2>/dev/null)
CURL_STATUS=$?
set -e
if [ "$CURL_STATUS" -ne 0 ]; then
HTTP_CODE="curl_error_${CURL_STATUS}"
fi
if [ "$HTTP_CODE" = "200" ]; then
echo "✅ API 健康檢查通過"
HEALTH_PASS=1

View File

@@ -1,3 +1,19 @@
## 2026-06-01CD public health 單次 timeout 重試化
**背景**
- IwoooS 證據解鎖工作佇列已推到 `main`,後續 workflow_dispatch 也完成 image build、ArgoCD sync 與 `awoooi-api` / `awoooi-web` / `awoooi-worker` rollout。
- Gitea CD run 在 build-and-deploy 後段被 public API health 的單次 `curl` timeout 標紅;人工即時檢查正式 API 為 healthy因此問題屬於 CD health probe 的錯誤熔斷,不是產品實際下線。
**本次調整**
- `.gitea/workflows/cd.yaml`build-and-deploy 最終 health check 改為捕捉 `curl` exit code 後再進入原有三次重試流程,並把單次 timeout 顯示為 `curl_error_<code>`
- 單次 probe 的 `max-time` 從 12 秒調整為 20 秒;仍保留三次重試與最後失敗才擋部署的邊界。
**進度邊界**
- 這是 CD 穩定性收斂;不新增資安執行權限、不啟動 Kali SSH / 掃描 / 主機更新、不切換 GitHub primary也不提高初期資安限制。
## 2026-06-01IwoooS 證據解鎖工作佇列
**背景**