diff --git a/bin/genieacs-cwmp.ts b/bin/genieacs-cwmp.ts index 2aa5b5d..af23a24 100755 --- a/bin/genieacs-cwmp.ts +++ b/bin/genieacs-cwmp.ts @@ -37,7 +37,9 @@ function exitWorkerGracefully(): void { db.disconnect(), extensions.killAll(), cluster.worker.disconnect(), - ]).catch(exitWorkerUngracefully); + ]) + .then(logger.close) + .catch(exitWorkerUngracefully); } function exitWorkerUngracefully(): void { diff --git a/bin/genieacs-fs.ts b/bin/genieacs-fs.ts index 97a4ad7..efa1d95 100755 --- a/bin/genieacs-fs.ts +++ b/bin/genieacs-fs.ts @@ -32,9 +32,9 @@ const SERVICE_PORT = config.get("FS_PORT") as number; function exitWorkerGracefully(): void { setTimeout(exitWorkerUngracefully, 5000).unref(); - Promise.all([db.disconnect(), cluster.worker.disconnect()]).catch( - exitWorkerUngracefully - ); + Promise.all([db.disconnect(), cluster.worker.disconnect()]) + .then(logger.close) + .catch(exitWorkerUngracefully); } function exitWorkerUngracefully(): void { diff --git a/bin/genieacs-nbi.ts b/bin/genieacs-nbi.ts index b334014..4732c0f 100755 --- a/bin/genieacs-nbi.ts +++ b/bin/genieacs-nbi.ts @@ -37,7 +37,9 @@ function exitWorkerGracefully(): void { db.disconnect(), extensions.killAll(), cluster.worker.disconnect(), - ]).catch(exitWorkerUngracefully); + ]) + .then(logger.close) + .catch(exitWorkerUngracefully); } function exitWorkerUngracefully(): void { diff --git a/bin/genieacs-ui.ts b/bin/genieacs-ui.ts index 03f5345..ec66bcf 100755 --- a/bin/genieacs-ui.ts +++ b/bin/genieacs-ui.ts @@ -37,7 +37,9 @@ function exitWorkerGracefully(): void { db.disconnect(), extensions.killAll(), cluster.worker.disconnect(), - ]).catch(exitWorkerUngracefully); + ]) + .then(logger.close) + .catch(exitWorkerUngracefully); } function exitWorkerUngracefully(): void {