Comparing version 1.0.0 to 1.1.0
28
index.js
@@ -14,3 +14,3 @@ var shisha = require('shisha'); | ||
var resources = {}; | ||
finder.on('file', function(file, stat) { | ||
@@ -20,3 +20,3 @@ var url = config.baseUrl + path.relative(dir, file); | ||
}); | ||
return new Promise(function(resolve){ | ||
@@ -37,6 +37,7 @@ finder.on('end', function() { | ||
}) | ||
if (Object.keys(failedResources).length) { | ||
sleep(config.sleep); | ||
retry(failedResources, currentTry, config); | ||
setTimeout(function(){ | ||
retry(failedResources, currentTry, config); | ||
}, config.sleep * 1000) | ||
} else { | ||
@@ -52,7 +53,7 @@ console.log("All resources are on the CDN"); | ||
* them again. | ||
* | ||
* | ||
* This process will be repeated as many times | ||
* as it's defined in config.tries or --tries from | ||
* the command line. | ||
* | ||
* | ||
* If the resources, after the Nth try, are still | ||
@@ -64,3 +65,3 @@ * unavailable, the process exists with a non-zero | ||
console.log("Attempting to verify everything is on the CDN (" + currentTry + ")"); | ||
if (currentTry === config.tries) { | ||
@@ -71,3 +72,3 @@ fail(failedResources); | ||
smoke(failedResources, currentTry, config); | ||
} | ||
} | ||
} | ||
@@ -80,10 +81,10 @@ | ||
var message = "Some resources weren't found on the CDN"; | ||
_.each(failedResources, function(resource){ | ||
message += "\n" + resource.url; | ||
}) | ||
var error = new Error(message); | ||
error.resources = failedResources; | ||
throw error; | ||
@@ -94,3 +95,3 @@ } | ||
* Runs the CDN checks. | ||
* | ||
* | ||
* Be sure all resources are uploaded | ||
@@ -109,2 +110,1 @@ * on the CDN, else this guy is gonna | ||
module.exports = run; | ||
{ | ||
"name": "cdnwhaaat", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Check that your files are on the CDN.", | ||
@@ -35,3 +35,2 @@ "main": "index.js", | ||
"shisha": "^0.4.0", | ||
"sleep": "^1.1.8", | ||
"yargs": "^1.3.3" | ||
@@ -38,0 +37,0 @@ }, |
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
5
111
67213
6
- Removedsleep@^1.1.8
- Removedmkdirp@0.3.5(transitive)
- Removedsleep@1.2.0(transitive)