fix(routes): complete post-refactor dependency wiring cleanup

This commit is contained in:
Krystie
2026-05-02 20:43:39 -07:00
parent 4eebb3ce7a
commit 0c658a26a8
32 changed files with 495 additions and 396 deletions

View File

@@ -67,8 +67,8 @@ process.on('uncaughtException', (error) => {
// Optional modules
let dockerMaintenance, logDigest;
try { dockerMaintenance = require('./docker-maintenance'); } catch (_) {}
try { logDigest = require('./log-digest'); } catch (_) {}
try { dockerMaintenance = require('./docker-maintenance'); } catch { /* optional */ }
try { logDigest = require('./log-digest'); } catch { /* optional */ }
log.info('server', 'Starting feature modules');
@@ -188,7 +188,7 @@ process.on('uncaughtException', (error) => {
});
// Graceful shutdown
function shutdown(signal) {
const shutdown = (signal) => {
log.info('shutdown', `${signal} received, draining connections...`);
const resourceMonitor = require('./resource-monitor');
@@ -206,12 +206,12 @@ process.on('uncaughtException', (error) => {
try {
const dockerMaintenance = require('./docker-maintenance');
dockerMaintenance.stop();
} catch (_) {}
} catch { /* optional */ }
try {
const logDigest = require('./log-digest');
logDigest.stop();
} catch (_) {}
} catch { /* optional */ }
server.close(() => {
log.info('shutdown', 'HTTP server closed');
@@ -220,7 +220,7 @@ process.on('uncaughtException', (error) => {
// Force exit after 5s if connections don't drain
setTimeout(() => process.exit(0), 5000).unref();
}
};
process.on('SIGTERM', () => shutdown('SIGTERM'));
process.on('SIGINT', () => shutdown('SIGINT'));