@nxtedition/lib 26.3.5 → 26.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/http.js +8 -0
- package/package.json +1 -1
package/http.js
CHANGED
|
@@ -247,6 +247,10 @@ export async function requestMiddleware(ctx, next) {
|
|
|
247
247
|
throw new Error('Response not completed')
|
|
248
248
|
}
|
|
249
249
|
|
|
250
|
+
if (stats?.completed != null) {
|
|
251
|
+
stats.completed++
|
|
252
|
+
}
|
|
253
|
+
|
|
250
254
|
const elapsedTime = performance.now() - startTime
|
|
251
255
|
|
|
252
256
|
if (isHealthcheck) {
|
|
@@ -263,6 +267,10 @@ export async function requestMiddleware(ctx, next) {
|
|
|
263
267
|
reqLogger?.debug({ res, elapsedTime }, 'request completed')
|
|
264
268
|
}
|
|
265
269
|
} catch (err) {
|
|
270
|
+
if (stats?.failed != null) {
|
|
271
|
+
stats.failed++
|
|
272
|
+
}
|
|
273
|
+
|
|
266
274
|
ctx[kAbortController]?.abort(err)
|
|
267
275
|
|
|
268
276
|
if (!req.closed) {
|