|
|
@ -1163,6 +1163,7 @@ shepherd.post('/forks', function(req, res, next) { |
|
|
|
args: [`-port=${_port}`], |
|
|
|
cwd: iguanaDir //set correct iguana directory
|
|
|
|
}, function(err, apps) { |
|
|
|
if (apps && apps[0] && apps[0].process && apps[0].process.pid) { |
|
|
|
iguanaInstanceRegistry[_port] = { |
|
|
|
'mode': mode, |
|
|
|
'coin': coin, |
|
|
@ -1171,6 +1172,21 @@ shepherd.post('/forks', function(req, res, next) { |
|
|
|
}; |
|
|
|
cache.setVar('iguanaInstances', iguanaInstanceRegistry); |
|
|
|
|
|
|
|
const successObj = { |
|
|
|
'msg': 'success', |
|
|
|
'result': _port |
|
|
|
}; |
|
|
|
|
|
|
|
res.end(JSON.stringify(successObj)); |
|
|
|
} else { |
|
|
|
const errorObj = { |
|
|
|
'msg': 'success', |
|
|
|
'error': 'iguana start error' |
|
|
|
}; |
|
|
|
|
|
|
|
res.end(JSON.stringify(errorObj)); |
|
|
|
} |
|
|
|
|
|
|
|
// get sync only forks info
|
|
|
|
if (syncOnlyInstanceInterval === -1) { |
|
|
|
setTimeout(function() { |
|
|
@ -1181,13 +1197,6 @@ shepherd.post('/forks', function(req, res, next) { |
|
|
|
}, 20000); |
|
|
|
} |
|
|
|
|
|
|
|
const successObj = { |
|
|
|
'msg': 'success', |
|
|
|
'result': _port |
|
|
|
}; |
|
|
|
|
|
|
|
res.end(JSON.stringify(successObj)); |
|
|
|
|
|
|
|
pm2.disconnect(); // Disconnect from PM2
|
|
|
|
if (err) { |
|
|
|
shepherd.writeLog(`iguana fork error: ${err}`); |
|
|
|