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:
parent
574eb284b9
commit
af54e272d2
@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user