[grade=pending] fix: eliminate CPU waste from duplicate workflows, self-updater crash loop, and aggressive polling
- 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:
@@ -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', () => {
|
||||
|
||||
Reference in New Issue
Block a user