feat(notify-bridge): phase 8 - integration and wiring

Wire all components into a working application:
- Scheduler service: APScheduler loads enabled trackers, polls at intervals
- Watcher service: orchestrates poll -> detect -> notify flow
  - Eagerly loads DB data, then creates aiohttp session for provider
  - Saves tracker state after each poll
  - Logs events to EventLog table
  - Dispatches notifications to targets with template rendering
- Manual trigger endpoint: POST /api/trackers/{id}/trigger
- Scheduler starts on app lifespan startup
- Full end-to-end flow verified: server starts cleanly

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-19 23:55:15 +03:00
parent 9dfd1b79cd
commit 08814e9ae2
4 changed files with 249 additions and 0 deletions
@@ -20,6 +20,8 @@ from .api.template_vars import router as template_vars_router
async def lifespan(app: FastAPI):
await init_db()
await _seed_default_templates()
from .services.scheduler import start_scheduler
await start_scheduler()
yield