Skip to content

Commit

Permalink
Haufe-Lexware/wicked.haufe.io#57 Set timeout to 2000ms for await.js
Browse files Browse the repository at this point in the history
  • Loading branch information
DonMartin76 committed Feb 15, 2017
1 parent 6fdcf15 commit 14e93c6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions env-reader.js
Expand Up @@ -262,9 +262,10 @@ function gatherEnvVarsInObject(fileName, ob, envDict) {
}
}

const _TIMEOUT = 2000;
function tryGet(url, maxTries, tryCounter, timeout, callback) {
debug('Try #' + tryCounter + ' to GET ' + url);
request.get({ url: url }, function (err, res, body) {
debug('Try #' + tryCounter + ' to GET ' + url + ' (timeout: ' + _TIMEOUT + 'ms)');
request.get({ url: url, timeout: _TIMEOUT }, function (err, res, body) {
var isOk = true;
if (err || res.statusCode != 200) {
if (tryCounter < maxTries || maxTries < 0)
Expand Down

0 comments on commit 14e93c6

Please sign in to comment.