increases wait time calc window to 90sec

This commit is contained in:
nai-degen 2023-05-13 13:32:37 -05:00
parent 977247d7a2
commit 546b28cca6
1 changed files with 2 additions and 2 deletions

View File

@ -188,7 +188,7 @@ function cleanQueue() {
}); });
const index = waitTimes.findIndex( const index = waitTimes.findIndex(
(waitTime) => now - waitTime.end > 60 * 1000 (waitTime) => now - waitTime.end > 90 * 1000
); );
const removed = waitTimes.splice(0, index + 1); const removed = waitTimes.splice(0, index + 1);
log.info( log.info(
@ -217,7 +217,7 @@ export function trackWaitTime(req: Request) {
/** Returns average wait time in milliseconds. */ /** Returns average wait time in milliseconds. */
export function getEstimatedWaitTime() { export function getEstimatedWaitTime() {
const now = Date.now(); const now = Date.now();
const lastMinute = waitTimes.filter((wt) => now - wt.end < 60 * 1000); const lastMinute = waitTimes.filter((wt) => now - wt.end < 90 * 1000);
if (lastMinute.length === 0) { if (lastMinute.length === 0) {
return 0; return 0;
} }