fix: use forEach instead of for-of to iterate Map entries
This commit is contained in:
@@ -60,11 +60,11 @@ export function checkUploadRateLimit(ipAddress: string): { allowed: boolean; rem
|
||||
*/
|
||||
export function cleanupRateLimitStore() {
|
||||
const now = Date.now();
|
||||
for (const [key, entry] of rateLimitStore.entries()) {
|
||||
rateLimitStore.forEach((entry, key) => {
|
||||
if (now > entry.resetAt) {
|
||||
rateLimitStore.delete(key);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Auto-cleanup every 10 minutes
|
||||
|
||||
Reference in New Issue
Block a user