Skip to content

Commit

Permalink
adjust maxAttempts + restore tests
Browse files Browse the repository at this point in the history
  • Loading branch information
emilymcafee committed Jul 16, 2017
1 parent 4093654 commit aa63d58
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/tilejson.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ TileJSON.prototype.get = function(url, callback) {
timeout: this.timeout,
headers: {Connection: 'Keep-Alive'},
agent: url.indexOf('https:') === 0 ? httpsagent : agent,
maxAttempts: 1,
maxAttempts: 2,
retryDelay: 0
}, function (err, res, buffer) {
if (!err && res.statusCode !== 200) {
Expand Down
4 changes: 2 additions & 2 deletions test/tilejson.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ tape('findID', function(assert) {
(setupServer(function() {
tilejson.getTile(2, 2, 2, function(err, data, headers) {
assert.equal(err.code, 'ECONNRESET');
assert.equal(connectionCount, 1);
assert.equal(connectionCount, 2);
server.close(assert.end);
});
}));
Expand All @@ -442,7 +442,7 @@ tape('findID', function(assert) {
setupServer(function() {
tilejson.getTile(5, 0, 0, function(err, data, headers) {
assert.equal(err.statusCode, 500);
assert.equal(connectionCount, 1);
assert.equal(connectionCount, 2);
server.close(assert.end);
});
});
Expand Down

0 comments on commit aa63d58

Please sign in to comment.