Skip to content

Commit db4695d

Browse files
committed
fix: use asyncTimer properly
1 parent 720c194 commit db4695d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/hydro.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ module.exports = class Hydro {
6868
})
6969
const token = this.generatePayloadHmac(body)
7070

71-
const fn = () => fetch(this.endpoint, {
71+
const doFetch = () => fetch(this.endpoint, {
7272
method: 'POST',
7373
body,
7474
headers: {
@@ -78,7 +78,7 @@ module.exports = class Hydro {
7878
}
7979
})
8080

81-
const res = await hydroStats.asyncTimer(fn, 'response_time')
81+
const res = await hydroStats.asyncTimer(doFetch, 'response_time')()
8282

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

0 commit comments

Comments
 (0)