[grade=pending] fix: eliminate CPU waste from duplicate workflows, self-updater crash loop, and aggressive polling
CI / Test & Lint (push) Canceled after 0s
CI / Security audit (push) Canceled after 0s

- Remove duplicate WorkflowEngine instantiation (was created in both app.js
  and server.js, causing every periodic workflow to fire twice)
- Fix self-updater _isNewer() crash loop: same-version different-commit was
  treated as 'update available', then crashed on undefined tarball path.
  Now only triggers on actual version bumps
- Increase container stats interval from 10s to 30s
- Increase health check interval from 30s to 60s
- Add disk cleanup debounce (skip if last cleanup < 30 min ago)
- Remove redundant disk-space-monitor from server.js (already in app.js)
- 69/69 tests pass
This commit is contained in:
Hermes
2026-08-13 10:57:20 -07:00
parent 9d085ebf94
commit 234df5038c
7 changed files with 48 additions and 21 deletions
@@ -91,15 +91,15 @@ describe('HealthChecker', () => {
describe('getBackoffInterval', () => {
it('returns base interval when no failures', () => {
const interval = healthChecker.getBackoffInterval('svc1');
expect(interval).toBe(30000); // CHECK_INTERVAL default
expect(interval).toBe(60000); // CHECK_INTERVAL default (60s)
});
it('doubles interval per consecutive failure', () => {
healthChecker.consecutiveFailures.set('svc1', 1);
expect(healthChecker.getBackoffInterval('svc1')).toBe(60000);
expect(healthChecker.getBackoffInterval('svc1')).toBe(120000);
healthChecker.consecutiveFailures.set('svc1', 2);
expect(healthChecker.getBackoffInterval('svc1')).toBe(120000);
expect(healthChecker.getBackoffInterval('svc1')).toBe(240000);
});
it('caps at MAX_CHECK_INTERVAL', () => {