grunt-cacheinfo
Advanced tools
Comparing version 0.4.6 to 0.4.7
{ | ||
"name": "grunt-cacheinfo", | ||
"description": "cacheinfo.", | ||
"version": "0.4.6", | ||
"version": "0.4.7", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "bachi", |
@@ -183,14 +183,29 @@ /* | ||
function getGlobalConfig(ok) { | ||
https.get(config_url, function (res) { | ||
var raw = ''; | ||
res.on('data', function (chunk) { | ||
raw += chunk.toString('utf8'); | ||
}); | ||
res.on('end', function () { | ||
ok(JSON.parse(raw)); | ||
}); | ||
}).on('error', function (e) { | ||
grunt.fail.fatal('错误:请求不到 ' + config_url); | ||
done(); | ||
}); | ||
let count = 0; | ||
function handleError() { | ||
if (count < 2) { | ||
count++; | ||
setTimeout(function() { | ||
_getGlobalConfig(); | ||
}, 3000); | ||
} else { | ||
grunt.fail.fatal('错误:请求不到 ' + config_url); | ||
done(); | ||
} | ||
} | ||
function _getGlobalConfig() { | ||
https.get(config_url, function (res) { | ||
var raw = ''; | ||
res.on('data', function (chunk) { | ||
raw += chunk.toString('utf8'); | ||
}); | ||
res.on('end', function () { | ||
ok(JSON.parse(raw)); | ||
}); | ||
}).on('error', handleError); | ||
} | ||
_getGlobalConfig(); | ||
} | ||
@@ -197,0 +212,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
17281
413