summaryrefslogtreecommitdiff
path: root/packages/backend/src/postgres.ts
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2024-07-21 11:02:46 +0100
committerdakkar <dakkar@thenautilus.net>2024-07-21 11:02:46 +0100
commit6e1e3bc0eae4f6ed8ae3e60088e099bf5074d01f (patch)
tree438987a39e9526ce43bef5521f1483c7d014b6d5 /packages/backend/src/postgres.ts
parentmerge: Stop banners and backgrounds from being animated when showing animated... (diff)
downloadsharkey-6e1e3bc0eae4f6ed8ae3e60088e099bf5074d01f.tar.gz
sharkey-6e1e3bc0eae4f6ed8ae3e60088e099bf5074d01f.tar.bz2
sharkey-6e1e3bc0eae4f6ed8ae3e60088e099bf5074d01f.zip
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)
Diffstat (limited to 'packages/backend/src/postgres.ts')
-rw-r--r--packages/backend/src/postgres.ts6
1 files changed, 1 insertions, 5 deletions
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,