Commit Graph

7 Commits

Author SHA1 Message Date
OG T
4f1c8ae473 fix(ci): Resolve Python and TypeScript lint errors
- Fix 35 Python ruff errors (B904, F841, E722, E741, B007, B008)
- Add eslint config for lewooogo-core package
- Update pyproject.toml to new ruff lint config format
- Relax frontend eslint rules to warnings for unused vars
- Allow console.* for debugging (TODO: unified logger)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-24 09:20:56 +08:00
OG T
6f049877fc fix(lint): ruff auto-fix + lewooogo-core src 加入 git
- Python: ruff --fix 修復 280 個 lint 錯誤
- lewooogo-core: src/ 目錄未追蹤,導致 CI eslint 失敗

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-23 23:51:37 +08:00
OG T
bd1f94dd72 fix(worker): 初始化 PostgreSQL 連線池 - 修復 Incident DB 持久化
問題:
- Signal Worker 沒有初始化 PostgreSQL,導致 incidents 表可能不存在
- Incident 只寫入 Redis,未持久化到 PostgreSQL
- 審核後無法正確更新 DB 狀態

修復:
- 在 Signal Worker 啟動時呼叫 init_db() 建立表
- 在關閉時呼叫 close_db() 釋放連線池
- 增加 PostgreSQL 初始化日誌

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-23 23:13:49 +08:00
OG T
9f353343c9 fix(worker): dedicated Redis pool with unlimited timeout for XREADGROUP
Root cause: Worker shared Redis pool with API (socket_timeout=5s),
but XREADGROUP blocks for 5s causing timeout errors every cycle.

Fix:
- Add init_worker_redis_pool() with socket_timeout=None
- Worker now uses get_worker_redis() for XREADGROUP operations
- API continues using get_redis() with short timeout

Also destroyed 50 zombie consumers via:
  XGROUP DESTROY stream:awoooi_signals awoooi_workers

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-23 09:42:11 +08:00
OG T
6d7486634b fix(worker): correct redis function names causing CrashLoopBackOff
signal_worker.py was importing non-existent init_redis/close_redis
Correct names are init_redis_pool/close_redis_pool

Root cause of:
- No Telegram alerts for 7+ hours
- No new approval cards
- No incident processing

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-23 09:19:01 +08:00
OG T
0c80f6a996 fix(worker): add standalone entry point for K8s deployment
- 新增 __main__ 入口點
- 寫入 health files for K8s probes
- Graceful shutdown 處理

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-22 19:56:15 +08:00
OG T
196d269b92 feat: add all application source code
- apps/api: FastAPI backend with Dockerfile
- apps/web: Next.js frontend with Dockerfile
- apps/sensor: Signal collection agent
- packages: shared packages

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-22 18:57:44 +08:00