diff options
-rw-r--r-- | lib/diagnostics_channel.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/diagnostics_channel.js b/lib/diagnostics_channel.js index 0ed3dffac26..9e95131639a 100644 --- a/lib/diagnostics_channel.js +++ b/lib/diagnostics_channel.js @@ -182,6 +182,7 @@ class TracingChannel { } traceSync(fn, ctx = {}, thisArg, ...args) { + if (!this.hasSubscribers) return ReflectApply(fn, thisArg, args); const { start, end, error } = this.#channels; start.publish(ctx); try { @@ -198,6 +199,7 @@ class TracingChannel { } tracePromise(fn, ctx = {}, thisArg, ...args) { + if (!this.hasSubscribers) return ReflectApply(fn, thisArg, args); const { asyncEnd, start, end, error } = this.#channels; start.publish(ctx); @@ -227,6 +229,7 @@ class TracingChannel { } traceCallback(fn, position = 0, ctx = {}, thisArg, ...args) { + if (!this.hasSubscribers) return ReflectApply(fn, thisArg, args); const { start, end, asyncEnd, error } = this.#channels; start.publish(ctx); |