1 parent 6f529e5 commit 2d62598Copy full SHA for 2d62598
1 file changed
src/components/utils/rateLimiter.ts
@@ -61,6 +61,16 @@ export async function rateLimiter(
61
);
62
}
63
64
+ if (isStillBlocked || entry.timestamps.length >= LIMIT) {
65
+ entry = await penalizeUser(lid, entry);
66
+
67
+ return {
68
+ value: entry,
69
+ status: true,
70
+ overLimit: entry.timestamps.length >= LIMIT,
71
+ };
72
+ }
73
74
entry.timestamps.push(now);
75
await redis.set(key, JSON.stringify(entry));
76
0 commit comments