Skip to content

Commit b75bd62

Browse files
committed
fix(http): remove process.nextTick
1 parent b3031d5 commit b75bd62

2 files changed

Lines changed: 5 additions & 11 deletions

File tree

lib/providers/httpTransaction/wraps/http.Server.prototype.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,7 @@ function wrapListener (listener, collector, config, mustCollectStore) {
6060
}
6161

6262
// Collect request start
63-
process.nextTick(function () {
64-
collector.emit(Collector.SERVER_RECV, collectorDataBag)
65-
})
63+
collector.emit(Collector.SERVER_RECV, collectorDataBag)
6664

6765
var serverSendTime
6866
/*
@@ -83,11 +81,9 @@ function wrapListener (listener, collector, config, mustCollectStore) {
8381
}
8482

8583
// Collect request ended
86-
process.nextTick(function () {
87-
debug('trace event (ss); request: %s, request finished', requestId)
88-
collector.emit(Collector.SERVER_SEND, collectorDataBag)
89-
delete mustCollectStore[requestId]
90-
})
84+
debug('trace event (ss); request: %s, request finished', requestId)
85+
collector.emit(Collector.SERVER_SEND, collectorDataBag)
86+
delete mustCollectStore[requestId]
9187
}
9288

9389
response.once('finish', instrumentedFinish)

lib/providers/httpTransaction/wraps/http.request.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,7 @@ function wrapRequest (originalHttpRequest, collector, config, mustCollectStore)
6565
}
6666

6767
// Collect request start
68-
process.nextTick(function () {
69-
collector.emit(Collector.CLIENT_SEND, collectorDataBag)
70-
})
68+
collector.emit(Collector.CLIENT_SEND, collectorDataBag)
7169

7270
/*
7371
* CLIENT_RECV

0 commit comments

Comments
 (0)