commits
node-cron@v4 throws an error when a scheduled task is skipped, and that caused the process to enter a while loop that logged each error, leading to a cpu spike that clogged the process and suspended operations. steps have been taken to prevent future issues by changing timezone to utc and wrapping the scheduled tasks in try catch blocks
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove unused errorResult variable in getEssentialStats()
- Change let to const for options object in handleGetTraffic()
🐙 Generated with Crush
Assisted-by: Claude Sonnet 4 via Crush <crush@charm.land>
- Add prepared statements for all traffic bucket upserts
- Add prepared statements for user agent and referer tracking
- Add prepared statements for user and emoji lookups
- Initialize all statements once at startup in initPreparedStatements()
- Eliminates SQL parsing overhead on every request
Prepared statements are pre-compiled by SQLite, avoiding repeated
query parsing and optimization on each call.
🐙 Generated with Crush
Assisted-by: Claude Sonnet 4 via Crush <crush@charm.land>
- Wrap all traffic bucket upserts (10min, hourly, daily) in a transaction
- Include user agent and referer tracking in same transaction
- Make recordRequest() synchronous (no longer async)
- Remove await from all recordAnalytics() calls in handlers
- Pre-parse referer URL outside transaction to minimize lock time
This reduces SQLite lock contention from 3-5 separate writes per request
down to a single atomic transaction.
🐙 Generated with Crush
Assisted-by: Claude Sonnet 4 via Crush <crush@charm.land>
/.github/images/screenshot.jpeg -- 469.96kb -> 388.17kb (17.4%)
Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com>
node-cron@v4 throws an error when a scheduled task is skipped, and that caused the process to enter a while loop that logged each error, leading to a cpu spike that clogged the process and suspended operations. steps have been taken to prevent future issues by changing timezone to utc and wrapping the scheduled tasks in try catch blocks
- Add prepared statements for all traffic bucket upserts
- Add prepared statements for user agent and referer tracking
- Add prepared statements for user and emoji lookups
- Initialize all statements once at startup in initPreparedStatements()
- Eliminates SQL parsing overhead on every request
Prepared statements are pre-compiled by SQLite, avoiding repeated
query parsing and optimization on each call.
🐙 Generated with Crush
Assisted-by: Claude Sonnet 4 via Crush <crush@charm.land>
- Wrap all traffic bucket upserts (10min, hourly, daily) in a transaction
- Include user agent and referer tracking in same transaction
- Make recordRequest() synchronous (no longer async)
- Remove await from all recordAnalytics() calls in handlers
- Pre-parse referer URL outside transaction to minimize lock time
This reduces SQLite lock contention from 3-5 separate writes per request
down to a single atomic transaction.
🐙 Generated with Crush
Assisted-by: Claude Sonnet 4 via Crush <crush@charm.land>