mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 22:00:31 +00:00
wip
This commit is contained in:
@@ -11,7 +11,7 @@ import { ThrottlerStorageRedisService } from '@nest-lab/throttler-storage-redis'
|
||||
useFactory: (configService: ConfigService) => {
|
||||
// Use in-memory storage with very high limits for test environment
|
||||
const isTest = process.env.NODE_ENV === 'test' || process.env.JEST_WORKER_ID !== undefined;
|
||||
|
||||
|
||||
if (isTest) {
|
||||
return {
|
||||
throttlers: [
|
||||
@@ -35,10 +35,11 @@ import { ThrottlerStorageRedisService } from '@nest-lab/throttler-storage-redis'
|
||||
const password = configService.get<string>('redis.password');
|
||||
const db = configService.get<number>('redis.db');
|
||||
|
||||
const globalTtl = configService.get<number>('throttle.global.ttl');
|
||||
const globalLimit = configService.get<number>('throttle.global.limit');
|
||||
const authTtl = configService.get<number>('throttle.auth.ttl');
|
||||
const authLimit = configService.get<number>('throttle.auth.limit');
|
||||
// Ensure we always have valid numbers with fallback defaults
|
||||
const globalTtl = configService.get<number>('throttle.global.ttl') ?? 60000;
|
||||
const globalLimit = configService.get<number>('throttle.global.limit') ?? 100;
|
||||
const authTtl = configService.get<number>('throttle.auth.ttl') ?? 60000;
|
||||
const authLimit = configService.get<number>('throttle.auth.limit') ?? 10;
|
||||
|
||||
return {
|
||||
throttlers: [
|
||||
|
||||
Reference in New Issue
Block a user