actionhero
Advanced tools
Comparing version 8.0.1 to 8.0.2
@@ -17,4 +17,4 @@ exports.default = { | ||
var toFakeRedis = false; | ||
if(process.env['fakeredis'] != null && process.env['fakeredis'] == 'true'){ | ||
toFakeRedis = false | ||
if(process.env.fakeredis == 'true'){ | ||
toFakeRedis = true; | ||
} | ||
@@ -21,0 +21,0 @@ |
@@ -68,7 +68,31 @@ var fs = require('fs'); | ||
configFiles = api.utils.recusiveDirecotryGlob(configPath); | ||
configFiles.forEach(function(f){ | ||
var localConfig = require(f); | ||
if(localConfig.default != null){ api.config = api.utils.hashMerge(api.config, localConfig.default, api); } | ||
if(localConfig[api.env] != null){ api.config = api.utils.hashMerge(api.config, localConfig[api.env], api); } | ||
var loadRetries = 0; | ||
var loadErrors = {}; | ||
for(var i = 0, limit = configFiles.length; (i < limit); i++){ | ||
var f = configFiles[i]; | ||
try{ | ||
// attempt configuration file load | ||
var localConfig = require(f); | ||
if(localConfig.default != null){ api.config = api.utils.hashMerge(api.config, localConfig.default, api); } | ||
if(localConfig[api.env] != null){ api.config = api.utils.hashMerge(api.config, localConfig[api.env], api); } | ||
// configuration file load success: clear retries and | ||
// errors since progress has been made | ||
loadRetries = 0; | ||
loadErrors = {}; | ||
} catch(error){ | ||
// error loading configuration, abort if all remaining | ||
// configuration files have been tried and failed | ||
// indicating inability to progress | ||
loadErrors[f] = error.toString(); | ||
if(++loadRetries == limit-i){ | ||
throw new Error('Unable to load configurations, errors: '+JSON.stringify(loadErrors)); | ||
} | ||
// adjust configuration files list: remove and push | ||
// failed configuration to the end of the list and | ||
// continue with next file at same index | ||
configFiles.push(configFiles.splice(i--, 1)[0]); | ||
continue; | ||
} | ||
// configuration file loaded: set watch | ||
api.watchFileAndAct(f, function(){ | ||
@@ -79,5 +103,5 @@ api.log('\r\n\r\n*** rebooting due to config change ***\r\n\r\n', 'info'); | ||
}); | ||
}) | ||
} | ||
// We load the config twice. | ||
// We load the config twice. Utilize configuration files load order that succeeded on the first pass. | ||
// This is to allow 'literal' values to be loaded whenever possible, and then for refrences to be resolved | ||
@@ -84,0 +108,0 @@ configFiles.forEach(function(f){ |
@@ -5,3 +5,3 @@ { | ||
"description": "actionhero.js is a multi-transport API Server with integrated cluster capabilities and delayed tasks", | ||
"version": "8.0.1", | ||
"version": "8.0.2", | ||
"homepage": "http://actionherojs.com", | ||
@@ -34,3 +34,3 @@ "repository": { | ||
"browser_fingerprint": "~0.0.4", | ||
"node-resque": "~0.3.6", | ||
"node-resque": "~0.5.0", | ||
"async": "~0.2.10", | ||
@@ -48,4 +48,4 @@ "formidable": "~1.0.14", | ||
"devDependencies": { | ||
"mocha": "~1.17.1", | ||
"should": "~2.1.1", | ||
"mocha": "~1.18.2", | ||
"should": "~3.1.4", | ||
"request": "~2.34.0" | ||
@@ -55,3 +55,3 @@ }, | ||
"grunt-contrib-clean": "~0.5.0", | ||
"grunt-contrib-jshint": "~0.8.0", | ||
"grunt-contrib-jshint": "~0.9.2", | ||
"grunt-contrib-uglify": "~0.4.0", | ||
@@ -58,0 +58,0 @@ "grunt-project-update": "~0.2.2", |
@@ -93,3 +93,3 @@ var fs = require('fs'); | ||
api.cache.load('testKeyInThePast', function(err, load_resp){ | ||
String(err).should.contain('Error: Object') | ||
String(err).should.include('Error: Object') | ||
should.equal(null, load_resp); | ||
@@ -96,0 +96,0 @@ done(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
463212
105
7936
+ Addedgrunt-contrib-jshint@0.9.2(transitive)
+ Addednode-resque@0.5.4(transitive)
- Removedgrunt-contrib-jshint@0.8.0(transitive)
- Removednode-resque@0.3.7(transitive)
Updatednode-resque@~0.5.0