fix results being cached for 6h with the new rate limits #1878

This commit is contained in:
Alexander Drozdov
2026-07-27 16:06:28 -05:00
committed by kvan7
parent 866ee71041
commit f5d2a6147e
+2 -2
View File
@@ -1,7 +1,7 @@
import type { RateLimiter } from "./RateLimiter";
import hash from "object-hash";
const MIN_TTL = 300;
const CACHE_TTL = 300;
export class Cache {
private cached = new Map<string, unknown>();
@@ -28,6 +28,6 @@ export class Cache {
}
static deriveTtl(...limits: RateLimiter[]): number {
return Math.max(MIN_TTL, ...limits.map((limit) => limit.window));
return limits.length ? CACHE_TTL : 0;
}
}