Refactor request listeners to use async functions
This commit is contained in:
1 parent
58488ebc3d
commit
7b8a49a7ba
11 files changed
+148
-163
No files matched your search
@@ -95,7 +95,7 @@ if (!cluster.worker) {
|
||||
exception: err,
|
||||
pid: process.pid,
|
||||
});
|
||||
server.stop().then(exitWorkerGracefully).catch(exitWorkerUngracefully);
|
||||
server.stop(false).then(exitWorkerGracefully).catch(exitWorkerUngracefully);
|
||||
});
|
||||
|
||||
const initPromise = db
|
||||
@@ -111,13 +111,19 @@ if (!cluster.worker) {
|
||||
|
||||
process.on("SIGINT", () => {
|
||||
initPromise.finally(() => {
|
||||
server.stop().then(exitWorkerGracefully).catch(exitWorkerUngracefully);
|
||||
server
|
||||
.stop(false)
|
||||
.then(exitWorkerGracefully)
|
||||
.catch(exitWorkerUngracefully);
|
||||
});
|
||||
});
|
||||
|
||||
process.on("SIGTERM", () => {
|
||||
initPromise.finally(() => {
|
||||
server.stop().then(exitWorkerGracefully).catch(exitWorkerUngracefully);
|
||||
server
|
||||
.stop(false)
|
||||
.then(exitWorkerGracefully)
|
||||
.catch(exitWorkerUngracefully);
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user