Fix: node-cron CPU/RAM Leak
Problem
Yarnl uses cron scheduling for automated backups (daily/weekly/monthly) and archive auto-deletion. The previous dependency, node-cron, has a known bug that seems to be triggered by the recent time zone change, where if the Node.js event loop gets blocked (e.g. during a backup job), it detects missed executions and logs a warning for every single one in a tight infinite loop. This loop never terminates, causing CPU and RAM usage to climb continuously until the container becomes unusable and must be restarted.
Solution
Replaced node-cron with croner, a modern cron scheduler that does not exhibit this behavior. croner uses standard cron expressions and is a drop-in replacement.
This is the same fix applied to the ZeroByte project: nicotsx/zerobyte#631 (comment)
Changes
package.json: Removednode-cron, addedcroner^9.0.0server.js: Updated all cron job creation fromcron.schedule(expr, fn)tonew Cron(expr, fn)- Every-minute backup scheduler
- Daily midnight archive auto-delete
References
- node-cron bug: node-cron/node-cron#492
- ZeroByte fix: nicotsx/zerobyte#631 (comment)
Full Changelog: v0.7.0...v0.7.1