diff --git a/src/index.ts b/src/index.ts index b62d753..5a81985 100644 --- a/src/index.ts +++ b/src/index.ts @@ -12,6 +12,7 @@ const buildGracefulServer = (server: Server, options?: IGracefulServerOptions): isReady: () => gracefulServer.status.isReady(), setReady: () => gracefulServer.status.setReady(), on: gracefulServer.on, + close: () => gracefulServer.shutdown("Success", 0), }; }; diff --git a/src/interface/gracefulServer.ts b/src/interface/gracefulServer.ts index db48304..42201cc 100644 --- a/src/interface/gracefulServer.ts +++ b/src/interface/gracefulServer.ts @@ -5,4 +5,5 @@ export type IGracefulServer = { setReady: () => void; // eslint-disable-next-line @typescript-eslint/no-explicit-any on: (name: string, callback: (...args: any[]) => void) => EventEmitter; + close: () => Promise; };