Skip to content

Commit

Permalink
fix: use asyncTimer properly
Browse files Browse the repository at this point in the history
  • Loading branch information
mikesurowiec committed Apr 6, 2021
1 parent 720c194 commit db4695d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/hydro.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ module.exports = class Hydro {
})
const token = this.generatePayloadHmac(body)

const fn = () => fetch(this.endpoint, {
const doFetch = () => fetch(this.endpoint, {
method: 'POST',
body,
headers: {
Expand All @@ -78,7 +78,7 @@ module.exports = class Hydro {
}
})

const res = await hydroStats.asyncTimer(fn, 'response_time')
const res = await hydroStats.asyncTimer(doFetch, 'response_time')()

hydroStats.increment(`response_code.${res.statusCode}`, 1)
hydroStats.increment('response_code.all', 1)
Expand Down

0 comments on commit db4695d

Please sign in to comment.