File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ POSTGRES_PORT=5432
33POSTGRES_USER=postgres
44POSTGRES_PASSWORD=postgres
55POSTGRES_DB=authentication-service
6+ POSTGRES_TENANT_MAX_CONNECTION_LIMIT=10
67REDIS_HOST=localhost
78REDIS_PORT=6379
89REDIS_CACHE_TTL=3600
Original file line number Diff line number Diff line change @@ -41,7 +41,9 @@ export async function getConnectionForTenant(
4141 synchronize : false ,
4242 logging : [ 'error' ] ,
4343 namingStrategy : new SnakeNamingStrategy ( ) ,
44- extra : { max : process . env . POSTGRES_TENANT_MAX_CONNECTION_LIMIT } ,
44+ ...( process . env . POSTGRES_TENANT_MAX_CONNECTION_LIMIT
45+ ? { extra : { max : process . env . POSTGRES_TENANT_MAX_CONNECTION_LIMIT } }
46+ : { } ) ,
4547 } ) . initialize ( ) ;
4648
4749 await switchToTenant ( tenantId , newConnection ) ;
You can’t perform that action at this time.
0 commit comments