Skip to content

Commit

Permalink
[fix] Destroy log file streams in a more intelligent way.
Browse files Browse the repository at this point in the history
  • Loading branch information
AvianFlu committed Apr 18, 2012
1 parent 89f3614 commit 2f93ba4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/forever/plugins/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,12 @@ exports.attach = function (options) {
monitor.on('restart', startLogs);

monitor.on('exit', function () {
monitor.stdout.end();
monitor.stderr.end();
if (monitor.stdout) {
monitor.stdout.destroySoon();
}
if (monitor.stderr) {
monitor.stderr.destroySoon();
}
});

function startLogs(child, childData) {
Expand Down

0 comments on commit 2f93ba4

Please sign in to comment.