OoO
|
55e14c0332
|
V10.605 修復當日業績匯入與資料庫備份
CD Pipeline / deploy (push) Successful in 9m17s
|
2026-06-15 14:52:33 +08:00 |
|
OoO
|
1d3da03eee
|
加速成長分析指紋快取
CD Pipeline / deploy (push) Successful in 1m2s
|
2026-05-19 13:24:11 +08:00 |
|
OoO
|
49f6b3ebd9
|
fix: parameterize import snapshot date filters
CD Pipeline / deploy (push) Successful in 1m3s
|
2026-05-18 14:23:49 +08:00 |
|
OoO
|
4e6e9bfe5d
|
綁定自動匯入日期查詢參數
|
2026-05-13 10:28:48 +08:00 |
|
OoO
|
153e4c9734
|
fix(observability): revert unrelated quick review commit files
CD Pipeline / deploy (push) Successful in 58s
|
2026-05-06 19:50:52 +08:00 |
|
OoO
|
308efdce25
|
chore(observability): clarify quick review completion copy
CD Pipeline / deploy (push) Successful in 1m4s
|
2026-05-06 19:49:28 +08:00 |
|
OoO
|
2f5666be08
|
feat(import): drive staleness gate active alert when DB stale >=3d (critic-approved)
Root cause (debugger 2026-05-02):
- drive_service.move_file 把 import 完的 Excel 搬到「已匯入」 → 工作夾空
- auto_import_from_drive 每 30 分跑一次 list 回空 → 走 line 671-677
silent return {success:True, file_count:0} → daily_sales_snapshot
自 4/27 12:54 後停更 8 天無任何告警
Patch:
Drive 空時加 staleness gate:查 DB MAX(snapshot_date),若距今 >=3 天
即呼叫既有 _send_data_stale_alert(commit dda0a06)發 Telegram 主動催促 BU 上傳。
critic 5 點修訂全照做:
1. session 自管:from database.manager import get_session + try/finally close
(此區段原本沒有 session 變數,在 line 708 才開)
2. 閾值 >=3 天:跨週末跨假期不上傳是常態,避免誤觸
3. 沿用 _send_data_stale_alert 既有 3 字串參數,不客製文案
4. dedupe key = 'upstream_drive':與下游 daily_report/weekly_strategy/
monthly_report 區隔,未來 ai_insights 查詢不混淆告警源
5. logger.error + exc_info=True:staleness 邏輯吞 try/except 不影響主流程
return success,但留 traceback 可觀測
Regression check:
- openclaw_strategist_service 不 import import_service → 無循環 import
- import path 'database.manager' 與 openclaw 既有用法一致(line 31)
- 找到檔案分支完全未動,主流程行為不變
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
2026-05-03 13:10:55 +08:00 |
|
OoO
|
779b27f676
|
修復 P0 告警自癒鏈與測試收集
CD Pipeline / deploy (push) Successful in 9m39s
|
2026-04-29 22:37:20 +08:00 |
|
OoO
|
3971fd4020
|
fix(daily_sales): cache 失效改 DB fingerprint + clear_cache 加 @login_required
CD Pipeline / deploy (push) Successful in 1m12s
回應 critic 對 8fefea0 的 4 個 HIGH finding(debugger/web-researcher/migration-engineer 三方共識):
HIGH-3 修復:
- /api/daily_sales/clear_cache 加 @login_required,避免外部 DoS 攻擊清快取
HIGH-4 修復(核心):
- 新增 _get_data_fingerprint(engine):SELECT MAX(snapshot_date), COUNT(*) FROM daily_sales_snapshot
- _is_cache_valid 改雙閘:TTL(保險絲)+ DB fingerprint(強一致)
- 三個 cache 寫入點同步記錄 fingerprint
- 移除 services/import_service.py 的 4-worker N-POST hack(命中率僅 9.4%,
coupon collector 機率:4!/4^4 = 0.094)
- 資料寫入後指紋自動跳號,4 worker 下次 request 各自偵測失效並重載 → 強一致
附帶修:
- 統一 export/export_marketing 兩處 cache 寫入結構(補 timestamp/fingerprint),
解決 db-expert 標記的「export 端點 cache 缺 timestamp 導致主看板每次都重讀」瑕疵
未處理(留待後續):
- HIGH-2: app.py 仍有 43 處 _SALES_PROCESSED_CACHE(sales_analysis 等其他路由的獨立 cache)
待後續 P9 統一抽 services/cache_manager.py
[P7-COMPLETION]
方案: critic + debugger + web-researcher + migration-engineer 四方共識的方案 B
影響: routes/daily_sales_routes.py + services/import_service.py 兩檔
Regression: 每 request 多 1 次 SELECT MAX/COUNT(< 5ms),其餘行為等價
|
2026-04-29 09:10:23 +08:00 |
|
OoO
|
8fefea05da
|
fix(daily_sales): 啟用 bp 版改進邏輯 + import 後跨 worker 清 cache,根除 #24 隱形 bug
CD Pipeline / deploy (push) Successful in 1m6s
- 從 app.py 刪除 396 行的 /daily_sales、/daily_sales/export、/daily_sales/export_marketing
三條 @app.route(行 5911-6306),讓 routes/daily_sales_routes.py 的 daily_sales_bp
生效(first-registered wins,原 app.py 版本 shadow 了 bp)。
- bp 版改進點:_is_cache_valid() 帶 5 分鐘 TTL、/api/daily_sales/clear_cache 端點、
完整模板參數(datetime_now / active_page)。
- services/import_service.py process_daily_sales_import return True 前,
新增跨 gunicorn worker 清 daily_sales cache 邏輯:依 GUNICORN_WORKERS 次數呼叫
internal /api/daily_sales/clear_cache,避免 4 worker 各持 5 分鐘舊快取
導致「匯入 15323 筆但當日業績看不到」隱形 bug。
[P7-COMPLETION]
- 方案正確: 雙重佐證(refactor-specialist + web-researcher)確認 Flask first-registered
wins,刪 app.py 內 route 即可讓 bp 接管;helper 函式(preprocess_daily_sales_data 等)
為 dead code 但保守保留不影響執行。
- 影響完整: 全 repo grep 確認 _SALES_PROCESSED_CACHE 在 app.py 仍有 30+ 處使用
(sales_analysis 等其他路由),未動到;helper 函式無外部 caller。
- Regression 風險: 低,bp 版簽名與行為相容;新 cache 清除走 internal HTTP 帶 try/except
不影響主流程;若 GUNICORN_WORKERS 未設則默認 4 與生產一致。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
2026-04-28 21:18:17 +08:00 |
|
ogt
|
1b4f3a7bbe
|
feat: EwoooC 初始化 — 完整專案推版至 Gitea
CD Pipeline / deploy (push) Failing after 59s
- 建立 Gitea Actions CD pipeline (.gitea/workflows/cd.yaml)
- 部署模式: rsync Python 檔案至 188 → docker restart (volume mount)
- Dockerfile/requirements 變動時自動重建 Docker image
- 部署通知: Telegram (開始/成功/失敗)
- 健康檢查: https://mo.wooo.work/health (最多 5 次重試)
- 同步最新 CLAUDE.md / ADR-008 / memory (2026-04-19)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-19 01:21:13 +08:00 |
|