Close log streams on process shutdown
This commit is contained in:
1 parent
4cb143cc0a
commit
7a142a4c08
4 files changed
+12
-6
No files matched your search
@@ -37,7 +37,9 @@ function exitWorkerGracefully(): void {
|
|||||||
db.disconnect(),
|
db.disconnect(),
|
||||||
extensions.killAll(),
|
extensions.killAll(),
|
||||||
cluster.worker.disconnect(),
|
cluster.worker.disconnect(),
|
||||||
]).catch(exitWorkerUngracefully);
|
])
|
||||||
|
.then(logger.close)
|
||||||
|
.catch(exitWorkerUngracefully);
|
||||||
}
|
}
|
||||||
|
|
||||||
function exitWorkerUngracefully(): void {
|
function exitWorkerUngracefully(): void {
|
||||||
|
|||||||
+3
-3
@@ -32,9 +32,9 @@ const SERVICE_PORT = config.get("FS_PORT") as number;
|
|||||||
|
|
||||||
function exitWorkerGracefully(): void {
|
function exitWorkerGracefully(): void {
|
||||||
setTimeout(exitWorkerUngracefully, 5000).unref();
|
setTimeout(exitWorkerUngracefully, 5000).unref();
|
||||||
Promise.all([db.disconnect(), cluster.worker.disconnect()]).catch(
|
Promise.all([db.disconnect(), cluster.worker.disconnect()])
|
||||||
exitWorkerUngracefully
|
.then(logger.close)
|
||||||
);
|
.catch(exitWorkerUngracefully);
|
||||||
}
|
}
|
||||||
|
|
||||||
function exitWorkerUngracefully(): void {
|
function exitWorkerUngracefully(): void {
|
||||||
|
|||||||
+3
-1
@@ -37,7 +37,9 @@ function exitWorkerGracefully(): void {
|
|||||||
db.disconnect(),
|
db.disconnect(),
|
||||||
extensions.killAll(),
|
extensions.killAll(),
|
||||||
cluster.worker.disconnect(),
|
cluster.worker.disconnect(),
|
||||||
]).catch(exitWorkerUngracefully);
|
])
|
||||||
|
.then(logger.close)
|
||||||
|
.catch(exitWorkerUngracefully);
|
||||||
}
|
}
|
||||||
|
|
||||||
function exitWorkerUngracefully(): void {
|
function exitWorkerUngracefully(): void {
|
||||||
|
|||||||
+3
-1
@@ -37,7 +37,9 @@ function exitWorkerGracefully(): void {
|
|||||||
db.disconnect(),
|
db.disconnect(),
|
||||||
extensions.killAll(),
|
extensions.killAll(),
|
||||||
cluster.worker.disconnect(),
|
cluster.worker.disconnect(),
|
||||||
]).catch(exitWorkerUngracefully);
|
])
|
||||||
|
.then(logger.close)
|
||||||
|
.catch(exitWorkerUngracefully);
|
||||||
}
|
}
|
||||||
|
|
||||||
function exitWorkerUngracefully(): void {
|
function exitWorkerUngracefully(): void {
|
||||||
|
|||||||
Reference in new issue
Block a user