Skip to content

Commit

Permalink
use TracingChannel#hasSubscribers
Browse files Browse the repository at this point in the history
  • Loading branch information
tlhunter committed May 9, 2024
1 parent b64f617 commit c5d68d4
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions lib/handleRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ function preHandlerCallback (err, request, reply) {

const context = request[kRouteContext]

if (!tcHasSubscribers() || context[kFourOhFourContext] === null) {
if (!channels.hasSubscribers || context[kFourOhFourContext] === null) {
preHandlerCallbackInner(err, request, reply)
} else {
const store = {
Expand Down Expand Up @@ -182,13 +182,5 @@ function preHandlerCallbackInner (err, request, reply, store) {
}
}

function tcHasSubscribers () {
return channels.start.hasSubscribers ||
channels.end.hasSubscribers ||
channels.asyncStart.hasSubscribers ||
channels.asyncEnd.hasSubscribers ||
channels.error.hasSubscribers
}

module.exports = handleRequest
module.exports[Symbol.for('internals')] = { handler, preHandlerCallback }

0 comments on commit c5d68d4

Please sign in to comment.