fix: address cleanup review lifecycle and connection settings

This commit is contained in:
Boki 2026-10-26 16:53:53 -04:00
parent 512f2f1c32
commit 9d3e1a7bb9
11 changed files with 264 additions and 17 deletions

View file

@ -20,6 +20,7 @@ export function registerCacheServices(
host: config.redis.host,
port: config.redis.port,
password: config.redis.password,
username: config.redis.username,
db: config.redis.db, // This will be overridden by ServiceCache
},
{ logger }
@ -37,6 +38,7 @@ export function registerCacheServices(
host: config.redis.host,
port: config.redis.port,
password: config.redis.password,
username: config.redis.username,
},
{ global: true, logger }
);

View file

@ -26,7 +26,7 @@ export function registerDatabaseServices(
uri: config.mongodb.uri,
poolSettings: {
maxPoolSize: config.mongodb.poolSize,
minPoolSize: 0,
minPoolSize: 1,
maxIdleTime: 10000,
},
};
@ -55,13 +55,8 @@ export function registerDatabaseServices(
max: config.postgres.poolSize,
idleTimeoutMillis: config.postgres.idleTimeout,
},
timeouts: {
connection: config.postgres.connectionTimeout,
query: 0,
statement: 0,
lock: 0,
idleInTransaction: 0,
},
// Omitted query/session limits retain the server's configured defaults.
timeouts: { connection: config.postgres.connectionTimeout },
};
logger.debug('PostgreSQL config:', {

View file

@ -38,6 +38,7 @@ export function registerApplicationServices(
host: config.redis.host,
port: config.redis.port,
password: config.redis.password,
username: config.redis.username,
db: 1, // Use cache DB (usually DB 1)
},
keyPrefix: 'cache:proxy:',
@ -70,6 +71,7 @@ export function registerApplicationServices(
host: config.redis.host,
port: config.redis.port,
password: config.redis.password,
username: config.redis.username,
db: config.redis.db,
},
defaultQueueOptions: {