From 6e1e3bc0eae4f6ed8ae3e60088e099bf5074d01f Mon Sep 17 00:00:00 2001 From: dakkar Date: Sun, 21 Jul 2024 11:02:46 +0100 Subject: pass redis config as-is to postgres cache also, explicitly state that `path` is a valid config option for redis (tells `ioredis` to connect via UNIX socked instead of TCP socket) --- packages/backend/src/postgres.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'packages/backend/src/postgres.ts') diff --git a/packages/backend/src/postgres.ts b/packages/backend/src/postgres.ts index 4a1b42383f..b7c418fa59 100644 --- a/packages/backend/src/postgres.ts +++ b/packages/backend/src/postgres.ts @@ -236,12 +236,8 @@ export function createPostgresDataSource(config: Config) { cache: !config.db.disableCache && process.env.NODE_ENV !== 'test' ? { // dbをcloseしても何故かredisのコネクションが内部的に残り続けるようで、テストの際に支障が出るため無効にする(キャッシュも含めてテストしたいため本当は有効にしたいが...) type: 'ioredis', options: { - host: config.redis.host, - port: config.redis.port, - family: config.redis.family ?? 0, - password: config.redis.pass, + ...config.redis, keyPrefix: `${config.redis.prefix}:query:`, - db: config.redis.db ?? 0, }, } : false, logging: log, -- cgit v1.2.3-freya