mirror of
https://github.com/Kvan7/Exiled-Exchange-2.git
synced 2026-08-24 22:46:44 +00:00
fix results being cached for 6h with the new rate limits #1878
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user