Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add a grace period to response timeout

  • Loading branch information...
commit 4503a011e0eefdf06dc72e3b63bb8fde21623fc8 1 parent d08eac3
@kanongil kanongil authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  lib/feed.js
View
3  lib/feed.js
@@ -29,6 +29,7 @@ var DEFAULT_HEARTBEAT = 30000;
var HEARTBEAT_TIMEOUT_COEFFICIENT = 1.25; // E.g. heartbeat 1000ms would trigger a timeout after 1250ms of no heartbeat.
var DEFAULT_MAX_RETRY_SECONDS = 60 * 60;
var INITIAL_RETRY_DELAY = 1000;
+var RESPONSE_GRACE_TIME = 5000;
var FEED_PARAMETERS = ['since', 'limit', 'feed', 'heartbeat', 'filter', 'include_docs', 'view'];
@@ -200,7 +201,7 @@ Feed.prototype.query = function query_feed() {
})
// The response headers must arrive within one heartbeat.
- var response_timer = setTimeout(response_timed_out, self.heartbeat)
+ var response_timer = setTimeout(response_timed_out, self.heartbeat + RESPONSE_GRACE_TIME)
, timed_out = false
return self.emit('query', feed_request)
Please sign in to comment.
Something went wrong with that request. Please try again.