mirror of
https://github.com/Unitech/pm2.git
synced 2026-02-01 16:57:09 +00:00
\#3134 double callback fix
This commit is contained in:
parent
f1c24d485f
commit
374f88ba0a
@ -2,6 +2,7 @@
|
||||
|
||||
- #3150 fix watchdog on agent
|
||||
- #3001 dump-backup feature
|
||||
- #3134 edge case error handling
|
||||
- #3096 fix module installation
|
||||
- #3085 honor every pm2 args on restart
|
||||
- #3046 better error message if PM2 is misconfigured
|
||||
|
||||
@ -154,14 +154,20 @@ var Utility = module.exports = {
|
||||
|
||||
flows.push(function(next){
|
||||
var file = stds[io];
|
||||
|
||||
// if file contains ERR or /dev/null, dont try to create stream since he dont want logs
|
||||
if (!file || file.indexOf('NULL') > -1 || file.indexOf('/dev/null') > -1)
|
||||
return next();
|
||||
|
||||
stds[io] = fs.createWriteStream(file, {flags: 'a'})
|
||||
.once('error', function(err){
|
||||
next(err);
|
||||
})
|
||||
.once('error', next)
|
||||
.on('open', function(){
|
||||
stds[io].removeListener('error', next);
|
||||
|
||||
stds[io].on('error', function(err) {
|
||||
console.error(err);
|
||||
});
|
||||
|
||||
next();
|
||||
});
|
||||
stds[io]._file = file;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user