inject buffer service, implement drain
This commit is contained in:
1 parent
860b2d6214
commit
5fab2d0a30
3 files changed
+6
No files matched your search
@@ -136,6 +136,7 @@ export const buildWorker = async (shared: SharedServices, envSettings: EnvConfig
|
||||
monitorsRepository,
|
||||
checksRepository,
|
||||
checkService,
|
||||
bufferService,
|
||||
checkProducer,
|
||||
checkEvaluator,
|
||||
geoCheckPipeline,
|
||||
|
||||
@@ -24,6 +24,7 @@ export const initShutdownListener = (server: Server | null, services: ShutdownTa
|
||||
|
||||
try {
|
||||
server?.close();
|
||||
await services.worker.drain();
|
||||
await services.worker.shutdown();
|
||||
await services.db.disconnect();
|
||||
logger.info({ message: "Graceful shutdown complete" });
|
||||
|
||||
@@ -154,6 +154,10 @@ export class JobScheduler implements IJobScheduler {
|
||||
return { success: true };
|
||||
};
|
||||
|
||||
drain = async () => {
|
||||
this.stopped = true;
|
||||
};
|
||||
|
||||
shutdown = async () => {
|
||||
this.stopped = true;
|
||||
// Stop all timers
|
||||
|
||||
Reference in new issue
Block a user