mirror of
https://github.com/spacebarchat/server.git
synced 2026-05-24 14:35:27 +00:00
eventually fix those errors
This commit is contained in:
@@ -71,7 +71,7 @@ export default function rateLimit(opts: {
|
||||
if (offender.blocked) {
|
||||
const global = bucket_id === "global";
|
||||
// each block violation pushes the expiry one full window further
|
||||
reset = new Date(reset.getTime() + opts.window * 1000);
|
||||
reset += opts.window * 1000;
|
||||
offender.expires_at = new Date(offender.expires_at.getTime() + opts.window * 1000);
|
||||
resetAfterMs = reset - Date.now();
|
||||
resetAfterSec = Math.ceil(resetAfterMs / 1000);
|
||||
|
||||
Reference in New Issue
Block a user