縮短 CD rebuild 切換停機窗口
Some checks failed
CD Pipeline / deploy (push) Failing after 1m6s

This commit is contained in:
OoO
2026-04-30 09:25:49 +08:00
parent 73561efa7a
commit 3193f1979d
11 changed files with 30 additions and 9 deletions

View File

@@ -86,3 +86,8 @@
### 6. `/metrics` 持續出現 realtime_sales_monthly 欄位不存在 warning
- **原因**: 線上表 schema 可能比 ORM 窄ORM count 會包子查詢並引用不存在欄位。
- **修復**: metrics 只需要總筆數時使用 `SELECT COUNT(*) FROM realtime_sales_monthly`,不要透過 `session.query(RealtimeSalesMonthly).count()`
### 7. Rebuild 模式造成長時間 502
- **原因**: CD 若先 `docker stop/rm``docker compose build --no-cache`build 耗時會全部變成服務中斷時間。
- **修復**: rebuild 模式必須先 `docker compose build --no-cache momo-app` 成功,才短暫 stop/rm/recreate `momo-app scheduler telegram-bot`
- **救急**: 若 build 已經在跑且三應用容器已被移除,可精準執行 `docker compose up -d --no-deps momo-app scheduler telegram-bot` 先恢復服務;禁止使用 `--remove-orphans`