chore: bump limiter from 1.1.5 to 2.1.0 (#6001)
* chore: bump limiter from 1.1.5 to 2.1.0 Bumps [limiter](https://github.com/jhurliman/node-rate-limiter) from 1.1.5 to 2.1.0. - [Release notes](https://github.com/jhurliman/node-rate-limiter/releases) - [Commits](https://github.com/jhurliman/node-rate-limiter/commits) --- updated-dependencies: - dependency-name: limiter dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Update limiter usage --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Asher <ash@coder.com>
This commit is contained in:
@ -12,8 +12,8 @@ import i18n from "../i18n"
|
||||
// RateLimiter wraps around the limiter library for logins.
|
||||
// It allows 2 logins every minute plus 12 logins every hour.
|
||||
export class RateLimiter {
|
||||
private readonly minuteLimiter = new Limiter(2, "minute")
|
||||
private readonly hourLimiter = new Limiter(12, "hour")
|
||||
private readonly minuteLimiter = new Limiter({ tokensPerInterval: 2, interval: "minute" })
|
||||
private readonly hourLimiter = new Limiter({ tokensPerInterval: 12, interval: "hour" })
|
||||
|
||||
public canTry(): boolean {
|
||||
// Note: we must check using >= 1 because technically when there are no tokens left
|
||||
|
Reference in New Issue
Block a user