diff options
author | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2022-09-11 21:56:00 +1000 |
---|---|---|
committer | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2022-09-11 21:56:00 +1000 |
commit | 4d23c4836d05c0817f39efadda47b03afbf61107 (patch) | |
tree | 276f832a016f731a224450c8712160bb87137be6 | |
parent | Trash ip logging (diff) | |
download | server-4d23c4836d05c0817f39efadda47b03afbf61107.tar.xz |
Trash ip logging for rate limits
-rw-r--r-- | api/src/middlewares/RateLimit.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/api/src/middlewares/RateLimit.ts b/api/src/middlewares/RateLimit.ts index 6613e25a..57645c0b 100644 --- a/api/src/middlewares/RateLimit.ts +++ b/api/src/middlewares/RateLimit.ts @@ -79,7 +79,7 @@ export default function rateLimit(opts: { resetAfterMs = reset - Date.now(); resetAfterSec = Math.ceil(resetAfterMs / 1000); - console.log("blocked bucket: " + bucket_id, { resetAfterMs }); + console.log(`blocked bucket: ${bucket_id} ${executor_id}`, { resetAfterMs }); return ( res .status(429) @@ -160,7 +160,7 @@ export async function initRateLimits(app: Router) { app.use("/auth/register", rateLimit({ onlyIp: true, success: true, ...routes.auth.register })); } -async function hitRoute(opts: { executor_id: string; bucket_id: string; max_hits: number; window: number }) { +async function hitRoute(opts: { executor_id: string; bucket_id: string; max_hits: number; window: number; }) { const id = opts.executor_id + opts.bucket_id; let limit = Cache.get(id); if (!limit) { |