Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 committed Mar 10, 2025
1 parent 1420c4c commit 5b593bb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions patch/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ function getRequestDetail(req, res, start, sent) {

let _onHttpServerRequestStart;
function subscribeHttpServerRequestStart(options) {
if (_onHttpServerRequestStart) {
return;
}

const { setHttpConfig, addLiveRequest, addCloseRequest, addSentRequest,
addRequestTimeout, addHttpStatusCode, addHttpProfilingDetail, patch_http_timeout } = options;

Expand Down Expand Up @@ -63,6 +67,7 @@ function unsubscribeHttpServerRequestStart() {

const diagnosticsChannel = require('diagnostics_channel');
diagnosticsChannel.unsubscribe('http.server.request.start', _onHttpServerRequestStart);
_onHttpServerRequestStart = null;
}

module.exports = { subscribeHttpServerRequestStart, unsubscribeHttpServerRequestStart };

0 comments on commit 5b593bb

Please sign in to comment.