Update RateLimit.ts
This commit is contained in:
parent
8769bb2868
commit
ea1f188cce
@ -71,7 +71,7 @@ export default function rateLimit(opts: {
|
|||||||
if (offender.blocked) {
|
if (offender.blocked) {
|
||||||
const global = bucket_id === "global";
|
const global = bucket_id === "global";
|
||||||
reset = reset + opts.window * 1000; // each block violation pushes the expiry one full window further
|
reset = reset + opts.window * 1000; // each block violation pushes the expiry one full window further
|
||||||
offender.expires_at += opts.window * 1000;
|
offender.expires_at = offender.expires_at + opts.window * 1000;
|
||||||
resetAfterMs = reset - Date.now();
|
resetAfterMs = reset - Date.now();
|
||||||
resetAfterSec = Math.ceil(resetAfterMs / 1000);
|
resetAfterSec = Math.ceil(resetAfterMs / 1000);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user