mirror of
https://github.com/screentinker/screentinker.git
synced 2026-06-18 20:22:42 -06:00
A player stuck in a tight loop (playlist with 0-second item durations) fires device:play-event 'play_start' ~3x/sec, inserting a play_logs row each time. Three web players doing this generated ~909k rows (99.9% with duration_sec=0) and grew the prod DB to 265 MB. Throttle proof-of-play inserts to at most one per device per 2s (in-memory lastPlayLogAt map). Skipped cycles create no row; the live dashboard progress event still fires every time, so the UI is unaffected. The play_end UPDATE only closes open rows, so throttling play_start is safe. (Junk rows already pruned in prod: 909k deleted, DB 265 MB -> 9.8 MB.) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| config | ||
| db | ||
| lib | ||
| middleware | ||
| player | ||
| routes | ||
| services | ||
| ws | ||
| .gitignore | ||
| config.js | ||
| package-lock.json | ||
| package.json | ||
| server.js | ||