Skip to content

Commit 1489295

Browse files
committed
rename var
1 parent 8a128a2 commit 1489295

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/dd-trace/src/exporters/common/request.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const { httpAgent, httpsAgent } = require('./agents')
1616

1717
const maxActiveRequests = 64e6
1818

19-
let activeRequests = 0
19+
let activeBufferSize = 0
2020

2121
function parseUrl (urlObjOrString) {
2222
if (urlObjOrString !== null && typeof urlObjOrString === 'object') return urlToHttpOptions(urlObjOrString)
@@ -126,14 +126,14 @@ function request (data, options, callback) {
126126
return callback(null)
127127
}
128128

129-
activeRequests += options.headers['Content-Length'] ?? 0
129+
activeBufferSize += options.headers['Content-Length'] ?? 0
130130

131131
storage('legacy').run({ noop: true }, () => {
132132
let finished = false
133133
const finalize = () => {
134134
if (finished) return
135135
finished = true
136-
activeRequests -= options.headers['Content-Length'] ?? 0
136+
activeBufferSize -= options.headers['Content-Length'] ?? 0
137137
}
138138

139139
const req = client.request(options, (res) => onResponse(res, finalize))
@@ -183,7 +183,7 @@ function byteLength (data) {
183183

184184
Object.defineProperty(request, 'writable', {
185185
get () {
186-
return activeRequests < maxActiveRequests
186+
return activeBufferSize < maxActiveRequests
187187
},
188188
})
189189

0 commit comments

Comments
 (0)