Skip to content

Commit

Permalink
feat: add block duration
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-yarmosh committed Sep 27, 2024
1 parent 1cc4733 commit 0c0be4c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib/rate-limiter/rate-limiter-get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ export const anonymousRateLimiter = new RateLimiterRedis({
keyPrefix: 'rate:get:anon',
points: config.get<number>('measurement.rateLimit.get.anonymousLimit'),
duration: config.get<number>('measurement.rateLimit.get.reset'),
blockDuration: 5,
});

export const authenticatedRateLimiter = new RateLimiterRedis({
storeClient: redisClient,
keyPrefix: 'rate:get:auth',
points: config.get<number>('measurement.rateLimit.get.authenticatedLimit'),
duration: config.get<number>('measurement.rateLimit.get.reset'),
blockDuration: 5,
});

const getRateLimiter = (ctx: ExtendedContext, extraId?: string): {
Expand Down

0 comments on commit 0c0be4c

Please sign in to comment.