Skip to content

Commit

Permalink
pinpoint-apm#86 rename refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
feelform committed Sep 12, 2023
1 parent 68339b2 commit 21a7ef9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/instrumentation/module/express.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ module.exports = function (agent, version, express) {
const result = original.apply(this, arguments)
const fn = arguments && arguments[1]
if (fn && fn.name !== 'router' && this.stack && this.stack.length) {
// log.debug('>> [Express] express.Router.use ', this.stack[this.stack.length - 1])
const layer = this.stack[this.stack.length - 1]
doPatchLayer(layer, 'middleware', layer.name)
}
Expand All @@ -63,12 +62,12 @@ module.exports = function (agent, version, express) {
// https://expressjs.com/en/4x/api.html
shimmer.wrap(express.Router, 'route', function (original) {
return function () {
const result = original.apply(this, arguments)
const route = original.apply(this, arguments)
if (this.stack && this.stack.length) {
const layer = this.stack[this.stack.length - 1]
doPatchLayer(layer, 'route', layer.name,)
}
return result
return route
}
})

Expand Down

0 comments on commit 21a7ef9

Please sign in to comment.