mirror of
https://github.com/Unitech/pm2.git
synced 2026-02-01 16:57:09 +00:00
(agent) fix info_node
This commit is contained in:
parent
5c7298fd15
commit
89d8b593ec
@ -355,9 +355,12 @@ InteractorDaemonizer.getOrSetConf = function(conf, infos, cb) {
|
||||
if (process.env.PM2_PUBLIC_KEY || process.env.KEYMETRICS_PUBLIC)
|
||||
public_key = process.env.PM2_PUBLIC_KEY || process.env.KEYMETRICS_PUBLIC;
|
||||
|
||||
if (new_connection && infos.info_node == null)
|
||||
if (new_connection && info_node == null)
|
||||
info_node = process.env.KEYMETRICS_NODE || cst.KEYMETRICS_ROOT_URL;
|
||||
|
||||
if (!info_node)
|
||||
info_node = cst.KEYMETRICS_ROOT_URL;
|
||||
|
||||
if (!secret_key)
|
||||
return cb(new Error('secret key is not defined'));
|
||||
|
||||
|
||||
@ -41,6 +41,10 @@ describe('Daemonizer interactor', function() {
|
||||
}, function(err, data) {
|
||||
should(err).be.null();
|
||||
data.info_node.should.eql(default_conf.KEYMETRICS_ROOT_URL);
|
||||
|
||||
var interaction_conf = json5.parse(fs.readFileSync(default_conf.INTERACTION_CONF));
|
||||
interaction_conf.info_node.should.eql(default_conf.KEYMETRICS_ROOT_URL);
|
||||
|
||||
return done();
|
||||
});
|
||||
});
|
||||
@ -51,6 +55,10 @@ describe('Daemonizer interactor', function() {
|
||||
data.secret_key.should.eql('xxx');
|
||||
data.public_key.should.eql('yyy');
|
||||
data.info_node.should.eql(default_conf.KEYMETRICS_ROOT_URL);
|
||||
|
||||
var interaction_conf = json5.parse(fs.readFileSync(default_conf.INTERACTION_CONF));
|
||||
interaction_conf.info_node.should.eql(default_conf.KEYMETRICS_ROOT_URL);
|
||||
|
||||
return done();
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user