brackt/server
Claude c175d70084 Phase 1: Replace per-second timer tick with event-driven scheduler
Eliminates the setInterval(1s) + per-second DB write by storing picksExpiresAt
in draft_timers and using a targeted setTimeout per pick. Clients count down
locally from the expiresAt timestamp, removing server-pushed timer-update events.

Key changes:
- database/schema.ts: add picksExpiresAt and picksStartedAt to draft_timers
- server/timer.ts: full rewrite — schedulePickForSeason, rescheduleTimer,
  30s recovery interval instead of 1s tick, overnight-pause resume scheduling
- server/socket.ts: new timer-pick-started / timer-overnight-paused events,
  updated draft-state-sync to include expiresAt for reconnect recovery
- draft.make-pick / draft.force-manual-pick: compute actual remaining from
  picksExpiresAt at pick time; call rescheduleTimer after the autodraft chain
- useDraftSocketEvents: handle new timer events, restore countdown on reconnect
- $leagueId.draft.$seasonId: client-side countdown useEffect from expiresAt
- plans/zero-downtime-scaling.md: full 4-phase scaling plan for future reference

Resolves 2351 unit tests (all passing).

https://claude.ai/code/session_019k5J6Ty7uP5HxSx6CsbiBK
2026-06-05 22:51:43 -07:00
..
__tests__ Phase 1: Replace per-second timer tick with event-driven scheduler 2026-06-05 22:51:43 -07:00
app.ts Block bot probe requests before routing (#444) 2026-05-18 11:17:18 -07:00
db.ts Add PgBouncer connection pooling support for Vultr managed PostgreSQL (#271) 2026-04-06 17:15:18 -04:00
logger.ts Replace console.* with structured logger, fix no-inferrable-types (closes #98) (#199) 2026-03-21 13:41:39 -07:00
snapshots.ts Add CS2 Major Qualifying Points simulator and stage management (#260) 2026-04-05 16:40:05 -04:00
socket.d.ts feat: integrate Socket.IO server with HTTP server and draft room functionality 2025-10-16 18:15:04 -07:00
socket.ts Phase 1: Replace per-second timer tick with event-driven scheduler 2026-06-05 22:51:43 -07:00
timer.ts Phase 1: Replace per-second timer tick with event-driven scheduler 2026-06-05 22:51:43 -07:00
types.d.ts Add oxlint linting setup with zero errors (#194) 2026-03-21 09:44:05 -07:00
virtual-modules.d.ts feat: integrate Socket.IO server with HTTP server and draft room functionality 2025-10-16 18:15:04 -07:00