inject buffer service, implement drain

This commit is contained in:
Alex Holliday committed 2026-06-24 12:17:02 -07:00
1 parent 860b2d6214
commit 5fab2d0a30
3 files changed
+6

No files matched your search

+1
View File
@@ -136,6 +136,7 @@ export const buildWorker = async (shared: SharedServices, envSettings: EnvConfig
monitorsRepository, monitorsRepository,
checksRepository, checksRepository,
checkService, checkService,
bufferService,
checkProducer, checkProducer,
checkEvaluator, checkEvaluator,
geoCheckPipeline, geoCheckPipeline,
+1
View File
@@ -24,6 +24,7 @@ export const initShutdownListener = (server: Server | null, services: ShutdownTa
try { try {
server?.close(); server?.close();
await services.worker.drain();
await services.worker.shutdown(); await services.worker.shutdown();
await services.db.disconnect(); await services.db.disconnect();
logger.info({ message: "Graceful shutdown complete" }); logger.info({ message: "Graceful shutdown complete" });
@@ -154,6 +154,10 @@ export class JobScheduler implements IJobScheduler {
return { success: true }; return { success: true };
}; };
drain = async () => {
this.stopped = true;
};
shutdown = async () => { shutdown = async () => {
this.stopped = true; this.stopped = true;
// Stop all timers // Stop all timers