Skip to content

Commit f4f9d37

Browse files
matt-aitkenericallam
authored andcommitted
Log a message out when the rate limiter is created
1 parent c055e65 commit f4f9d37

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

apps/webapp/app/services/rateLimiter.server.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export class RateLimiter {
2020

2121
constructor(private readonly options: Options) {
2222
const { redis, keyPrefix, limiter } = options;
23+
const prefix = `ratelimit:${keyPrefix}`;
2324
this.#ratelimit = new Ratelimit({
2425
redis: createRedisRateLimitClient(
2526
redis ?? {
@@ -34,7 +35,12 @@ export class RateLimiter {
3435
limiter,
3536
ephemeralCache: new Map(),
3637
analytics: false,
37-
prefix: `ratelimit:${keyPrefix}`,
38+
prefix,
39+
});
40+
41+
logger.info(`RateLimiter (${keyPrefix}): initialized`, {
42+
keyPrefix,
43+
redisKeyspace: prefix,
3844
});
3945
}
4046

0 commit comments

Comments
 (0)