Browse Source

too many komodod restarts notification

all-modes
pbca26 8 years ago
parent
commit
56f4935e39
  1. 21
      routes/shepherd.js

21
routes/shepherd.js

@ -318,6 +318,23 @@ shepherd.post('/herd', function(req, res) {
};
res.end(JSON.stringify(obj));
if (req.body.herd === 'komodod') {
var _port = assetChainPorts[req.body.options.ac_name];
// check if komodod instance is already running
setTimeout(function() {
portscanner.checkPortStatus(_port, '127.0.0.1', function(error, status) {
// Status is 'open' if currently in use or 'closed' if available
if (status === 'closed') {
cache.io.emit('service', {
'komodod': {
'error': 'start error'
}
});
}
});
}, 10000);
}
});
/*
@ -628,8 +645,10 @@ function herder(flock, data) {
cwd: iguanaDir //set correct iguana directory
}, function(err, apps) {
pm2.disconnect(); // Disconnect from PM2
if (err)
if (err) {
throw err;
console.log('iguana fork error: ' + err);
}
});
});
}

Loading…
Cancel
Save