Skip to content

Commit 2557cca

Browse files
committed
fix(pg): use callback when they are provided
1 parent ce9a5ab commit 2557cca

File tree

1 file changed

+3
-1
lines changed
  • lib/instrumentations

1 file changed

+3
-1
lines changed

lib/instrumentations/pg.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@ function wrapClient (pg, agent) {
2626
var url = this.database
2727
var port = this.port
2828
var args = Array.prototype.slice.apply(arguments)
29+
var isCallback = typeof args[args.length - 1] === 'function'
2930

3031
return utils.wrapQuery.call(this, original, args, agent, {
3132
protocol: consts.PROTOCOLS.POSTGRES,
3233
url: url,
3334
host: port ? host + ':' + port : host,
34-
method: utils.tryParseSql(args[0])
35+
method: utils.tryParseSql(args[0]),
36+
disableCallback: !isCallback
3537
})
3638
}
3739
})

0 commit comments

Comments
 (0)