enhance(PostgreSQL): DBのクエリーのキャッシュに使われるRedisの設定を分ける (MisskeyIO#322)

This commit is contained in:
まっちゃとーにゅ
2024-01-05 19:15:04 +09:00
committed by GitHub
parent f950abcf2c
commit bb0da10d73
2 changed files with 5 additions and 6 deletions

View File

@@ -230,12 +230,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,
keyPrefix: `${config.redis.prefix}:query:`,
db: config.redis.db ?? 0,
...config.redisForDatabaseCache,
keyPrefix: `${config.redisForDatabaseCache.prefix}:query:`,
},
} : false,
logging: log,