mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 08:26:16 -04:00
server: Use wtfnode to log reasons why node isn't exiting
This commit is contained in:
parent
ba81ead101
commit
877f0c5883
4 changed files with 19 additions and 2 deletions
|
@ -27,6 +27,10 @@
|
|||
const log4js = require('log4js');
|
||||
log4js.replaceConsole();
|
||||
|
||||
// wtfnode should be loaded after log4js.replaceConsole() so that it uses log4js for logging, and it
|
||||
// should be above everything else so that it can hook in before resources are used.
|
||||
const wtfnode = require('wtfnode');
|
||||
|
||||
/*
|
||||
* early check for version compatibility before calling
|
||||
* any modules that require newer versions of NodeJS
|
||||
|
@ -211,6 +215,7 @@ exports.exit = async (err = null) => {
|
|||
setTimeout(() => {
|
||||
console.error('Something that should have been cleaned up during the shutdown hook (such as ' +
|
||||
'a timer, worker thread, or open connection) is preventing Node.js from exiting');
|
||||
wtfnode.dump();
|
||||
console.error('Forcing an unclean exit...');
|
||||
process.exit(1);
|
||||
}, 5000).unref();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue