enable rate limits for dev environment

This commit is contained in:
Hazelnoot 2024-12-09 19:04:59 -05:00
parent 9daafca155
commit ead781900d
2 changed files with 2 additions and 2 deletions

View file

@ -24,7 +24,7 @@ export class SkRateLimiterService {
@Inject(EnvService)
envService: EnvService,
) {
this.disabled = envService.env.NODE_ENV !== 'production';
this.disabled = envService.env.NODE_ENV === 'test';
}
public async limit(limit: Keyed<RateLimit>, actor: string, factor = 1): Promise<LimitInfo> {

View file

@ -120,7 +120,7 @@ describe(SkRateLimiterService, () => {
});
});
it('should bypass in non-production', async () => {
it('should bypass in test environment', async () => {
mockEnvironment.NODE_ENV = 'test';
const info = await serviceUnderTest().limit({ key: 'l', type: undefined, max: 0 }, actor);