mirror of
https://github.com/log4js-node/log4js-node.git
synced 2025-12-08 19:26:01 +00:00
Merge pull request #347 from rlidwka/master
fix shutdown callbacks not being called
This commit is contained in:
commit
40bd1e15e8
@ -65,6 +65,9 @@ function shutdown(cb) {
|
||||
cb(error);
|
||||
}
|
||||
};
|
||||
if (!openFiles.length) {
|
||||
return cb();
|
||||
}
|
||||
openFiles.forEach(function(file) {
|
||||
if (!file.write(eol, "utf-8")) {
|
||||
file.once('drain', function() {
|
||||
|
||||
@ -93,6 +93,9 @@ function shutdown(cb) {
|
||||
cb(error);
|
||||
}
|
||||
};
|
||||
if (!openFiles.length) {
|
||||
return cb();
|
||||
}
|
||||
openFiles.forEach(function(file) {
|
||||
if (!file.write(eol, "utf-8")) {
|
||||
file.once('drain', function() {
|
||||
|
||||
@ -444,6 +444,9 @@ function shutdown(cb) {
|
||||
shutdownFcts.push(appenderShutdowns[category]);
|
||||
}
|
||||
}
|
||||
if (!shutdownFcts.length) {
|
||||
return cb();
|
||||
}
|
||||
shutdownFcts.forEach(function(shutdownFct) { shutdownFct(complete); });
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user