Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

Commit

Permalink
Merge 62b8048 into d4569d1
Browse files Browse the repository at this point in the history
  • Loading branch information
jpwilliams committed Jan 29, 2018
2 parents d4569d1 + 62b8048 commit 9588a37
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/Request.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ class Request extends CallableInstance {
message.priority = parsedOptions.priority
}

let timeout = 30000
let givenTimeout = Number(parsedOptions.timeout)
if (!isNaN(givenTimeout)) timeout = givenTimeout

if (timeout) message.expiration = timeout

let parsedData
let eventData = data

Expand Down Expand Up @@ -136,10 +142,6 @@ class Request extends CallableInstance {

this._emitter.emit('sent', event)

let timeout = 30000
let givenTimeout = Number(parsedOptions.timeout)
if (!isNaN(givenTimeout)) timeout = givenTimeout

if (timeout) {
this._setTimer(messageId, timeout, event)
}
Expand Down
1 change: 1 addition & 0 deletions test/request.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ describe('Request', function () {
})

it('should return fallback if timing out and fallback set')
it('should expire from queue after same time as timeout')
it('should send NULL if given unparsable data')
})
})

0 comments on commit 9588a37

Please sign in to comment.