fix NaN from extremely high rate limits

This commit is contained in:
Hazelnoot 2024-12-08 09:22:38 -05:00
parent 2781f53d6b
commit a7a1edc92e
2 changed files with 15 additions and 1 deletions

View file

@ -155,7 +155,7 @@ export class SkRateLimiterService {
type: 'bucket',
key: limit.key,
size: limit.max,
dripRate: Math.round(limit.duration / limit.max),
dripRate: Math.max(Math.round(limit.duration / limit.max), 1),
}, actor, factor),
);
}