From b84ccce1a5cc7087af902f71749354e53aa1ffa8 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Thu, 27 Apr 2017 14:42:21 +0300 Subject: [PATCH] store iguana core instances pid --- routes/shepherd.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/routes/shepherd.js b/routes/shepherd.js index 299c82b..69a30eb 100644 --- a/routes/shepherd.js +++ b/routes/shepherd.js @@ -268,7 +268,10 @@ shepherd.post('/forks', function(req, res, next) { args: ['-port=' + _port], cwd: iguanaDir //set correct iguana directory }, function(err, apps) { - iguanaInstanceRegistry[_port] = name; + iguanaInstanceRegistry[_port] = { + 'name': name, + 'pid': apps[0].process.pid + }; cache.setVar('iguanaInstances', iguanaInstanceRegistry); var successObj = { @@ -718,7 +721,10 @@ function herder(flock, data) { args: ['-port=' + shepherd.appConfig.iguanaCorePort], cwd: iguanaDir //set correct iguana directory }, function(err, apps) { - iguanaInstanceRegistry[shepherd.appConfig.iguanaCorePort] = 'main'; + iguanaInstanceRegistry[shepherd.appConfig.iguanaCorePort] = { + 'name': 'main', + 'pid': apps[0].process.pid + }; pm2.disconnect(); // Disconnect from PM2 if (err) { throw err; @@ -1076,8 +1082,8 @@ function setConf(flock) { function getConf(flock) { var komodoDir = '', - ZcashDir = '', - DaemonConfPath = ''; + ZcashDir = '', + DaemonConfPath = ''; console.log(flock);