Merge pull request #347 from rlidwka/master

fix shutdown callbacks not being called
This commit is contained in:
Gareth Jones 2016-02-01 09:37:37 +11:00
commit 40bd1e15e8
3 changed files with 9 additions and 0 deletions

View File

@ -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() {

View File

@ -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() {

View File

@ -444,6 +444,9 @@ function shutdown(cb) {
shutdownFcts.push(appenderShutdowns[category]);
}
}
if (!shutdownFcts.length) {
return cb();
}
shutdownFcts.forEach(function(shutdownFct) { shutdownFct(complete); });
}