We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4c37eef commit 15c5f08Copy full SHA for 15c5f08
src/App.ts
@@ -51,8 +51,9 @@ export class App {
51
});
52
}
53
54
- public async stop(): Promise<void> {
+ public async stop(signal: string): Promise<void> {
55
await this.instance.close();
56
+ process.kill(process.pid, signal);
57
58
59
private registerPlugins(): void {
@@ -88,4 +89,4 @@ declare module "fastify" {
88
89
config: Config;
90
db: Connection;
91
-}
92
+}
src/index.ts
@@ -3,8 +3,10 @@ import nodeCleanup from "node-cleanup";
3
4
const app = new App();
5
6
-nodeCleanup(function () {
7
- app.stop();
+nodeCleanup(function (exitCode, signal) {
+ app.stop(signal as string);
8
+ nodeCleanup.uninstall();
9
+ return false;
10
11
-app.start();
12
+app.start();
0 commit comments