Comparing version 0.18.1 to 0.18.2
@@ -53,7 +53,7 @@ /** | ||
if (!err) { | ||
_.map(confs, function (conf) { | ||
validate(conf.serviceID, conf); | ||
_.map(confs, function (conf, serviceID) { | ||
validate(serviceID, conf); | ||
if (conf._isValid === true) { | ||
config[conf.serviceID] = conf; | ||
contextCache[conf.serviceID] = {}; | ||
config[serviceID] = conf; | ||
contextCache[serviceID] = {}; | ||
} | ||
@@ -183,2 +183,5 @@ }); | ||
data = require(filePath); | ||
if (data) { | ||
data = ralUtil.deepClone(data); | ||
} | ||
} | ||
@@ -185,0 +188,0 @@ else if (ext === '.json') { |
@@ -142,3 +142,5 @@ /** | ||
logger.fatal('config normalize failed'); | ||
fs.close(fd); | ||
fs.close(fd, function (err) { | ||
err && logger.warning('failed config_cache close: ' + err.message); | ||
}); | ||
// delete failed file | ||
@@ -145,0 +147,0 @@ fs.unlink(me.dataPath, function (err) { |
{ | ||
"name": "node-ral", | ||
"version": "0.18.1", | ||
"version": "0.18.2", | ||
"description": "a rpc client for node", | ||
@@ -39,3 +39,3 @@ "main": "index.js", | ||
"urlencode": "1.1.0", | ||
"yog-log": "0.1.3" | ||
"yog-log": "^0.1.8" | ||
}, | ||
@@ -42,0 +42,0 @@ "devDependencies": { |
@@ -18,2 +18,3 @@ node-ral | ||
- [x] node 6.x | ||
- [x] node 8.x | ||
@@ -20,0 +21,0 @@ > io.js 1.63至1.8.1版本不支持GBK编码 |
@@ -97,2 +97,25 @@ /** | ||
(process.env.CI ? it : it.skip)('update configs of shared object successful', function (done) { | ||
var fake = { | ||
normalizeConfig: function (conf) { | ||
return conf; | ||
}, | ||
needUpdate: function () { | ||
return true; | ||
} | ||
}; | ||
normalizeManager.setConfigNormalizer([fake, 'default']); | ||
config.load(path.join(__dirname, './update/config')); | ||
config.enableUpdate(300000, true); | ||
// read:succ事件在config更新之后才触发 | ||
configUpdater.once('read:succ', function () { | ||
config.disableUpdate(); | ||
config.getConfNames().map(function (serviceID) { | ||
var conf = config.getConf(serviceID); | ||
conf.__from__.should.be.startWith('updater'); | ||
}); | ||
done(); | ||
}); | ||
}); | ||
(process.env.CI ? it : it.skip)('auto updater should be triggered when normalizer need update', function (done) { | ||
@@ -99,0 +122,0 @@ var fake = { |
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
380008
11096
155
31
14
+ Addedcallsites@3.1.0(transitive)
+ Addedyog-log@0.1.14(transitive)
- Removedyog-log@0.1.3(transitive)
Updatedyog-log@^0.1.8