Skip to content

Commit

Permalink
Merge pull request #318 from tulios/max-between-default-and-configure…
Browse files Browse the repository at this point in the history
…d-timeout

Use the max between the default request timeout and the protocol override
  • Loading branch information
tulios committed Apr 1, 2019
1 parent 52ed00b commit 695164c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/network/requestQueue/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@ module.exports = class RequestQueue {
const { correlationId } = pushedRequest.entry
const defaultRequestTimeout = this.requestTimeout
const customRequestTimeout = pushedRequest.requestTimeout
const requestTimeout =
customRequestTimeout == null ? defaultRequestTimeout : customRequestTimeout

// Some protocol requests have custom request timeouts (e.g JoinGroup, Fetch, etc). The custom
// timeouts are influenced by user configurations, which can be lower than the default requestTimeout
const requestTimeout = Math.max(defaultRequestTimeout, customRequestTimeout || 0)

const socketRequest = new SocketRequest({
entry: pushedRequest.entry,
Expand Down

0 comments on commit 695164c

Please sign in to comment.