1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00

fix: added a check to avoid double counting (#6925)

Due to how we handle redirects of embedded proxy, we ended up counting
the same request twice. This PR adds a boolean to res.locals which we
then check if set to avoid double counting.
This commit is contained in:
Christopher Kolstad 2024-04-25 10:08:23 +02:00 committed by GitHub
parent 574eb284b9
commit af54e272d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -70,7 +70,9 @@ export function responseTimeMetrics(
time,
appName,
};
eventBus.emit(REQUEST_TIME, timingInfo);
if (!res.locals.responseTimeEmitted) {
res.locals.responseTimeEmitted = true;
eventBus.emit(REQUEST_TIME, timingInfo);
}
});
}