diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/jobctl.js | 7 | ||||
-rwxr-xr-x | src/jobd-master.js | 7 | ||||
-rwxr-xr-x | src/jobd.js | 9 | ||||
-rw-r--r-- | src/lib/logger.js | 5 |
4 files changed, 14 insertions, 14 deletions
diff --git a/src/jobctl.js b/src/jobctl.js index ca96b24..887a073 100755 --- a/src/jobctl.js +++ b/src/jobctl.js @@ -346,13 +346,12 @@ Configuration file process.exit(exitCode) } -function term() { +async function term() { if (logger) logger.info('shutdown') - loggerModule.shutdown(function() { - process.exit() - }) + await loggerModule.shutdown() + process.exit() } async function exists(file) { diff --git a/src/jobd-master.js b/src/jobd-master.js index c926dc0..9827126 100755 --- a/src/jobd-master.js +++ b/src/jobd-master.js @@ -306,11 +306,10 @@ Options: console.log(s) } -function term() { +async function term() { if (logger) logger.info('shutdown') - loggerModule.shutdown(function() { - process.exit() - }) + await loggerModule.shutdown() + process.exit() } diff --git a/src/jobd.js b/src/jobd.js index 0d8af32..e1331d1 100755 --- a/src/jobd.js +++ b/src/jobd.js @@ -448,11 +448,10 @@ Options: console.log(s) } -function term() { +async function term() { if (logger) logger.info('shutdown') - loggerModule.shutdown(function() { - process.exit() - }) -}
\ No newline at end of file + await loggerModule.shutdown() + process.exit() +} diff --git a/src/lib/logger.js b/src/lib/logger.js index 8a44e07..f886e0c 100644 --- a/src/lib/logger.js +++ b/src/lib/logger.js @@ -102,9 +102,12 @@ module.exports = { /** * @param cb + * @return {Promise} */ shutdown(cb) { - log4js.shutdown(cb) + return new Promise((resolve, reject) => { + log4js.shutdown(resolve) + }) }, Logger: log4js.Logger, |