From 37f34bccf3a4ae428928fefdf5188c4d093f63eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=BE=E3=81=A3=E3=81=A1=E3=82=83=E3=81=A8=E3=83=BC?= =?UTF-8?q?=E3=81=AB=E3=82=85?= <17376330+u1-liquid@users.noreply.github.com> Date: Fri, 9 Feb 2024 03:50:53 +0900 Subject: [PATCH] =?UTF-8?q?spec(backend):=20=E3=83=87=E3=83=BC=E3=82=BF?= =?UTF-8?q?=E3=83=99=E3=83=BC=E3=82=B9=E3=81=AE=E3=82=AD=E3=83=A3=E3=83=83?= =?UTF-8?q?=E3=82=B7=E3=83=A5=E3=81=ABRedis=E3=81=AE=E4=BB=A3=E3=82=8F?= =?UTF-8?q?=E3=82=8A=E3=81=ABin-memory=E3=82=AD=E3=83=A3=E3=83=83=E3=82=B7?= =?UTF-8?q?=E3=83=A5=E3=82=92=E4=BD=BF=E7=94=A8=E3=81=99=E3=82=8B=20(Missk?= =?UTF-8?q?eyIO#416)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/backend/src/config.ts | 3 --- packages/backend/src/postgres.ts | 8 +------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/packages/backend/src/config.ts b/packages/backend/src/config.ts index add5d59d9b..568285f623 100644 --- a/packages/backend/src/config.ts +++ b/packages/backend/src/config.ts @@ -46,7 +46,6 @@ type Source = { pass: string; }[]; redis: RedisOptionsSource; - redisForDatabaseCache?: RedisOptionsSource; redisForPubsub?: RedisOptionsSource; redisForJobQueue?: RedisOptionsSource; redisForSystemQueue?: RedisOptionsSource; @@ -177,7 +176,6 @@ export type Config = { externalMediaProxyEnabled: boolean; videoThumbnailGenerator: string | null; redis: RedisOptions & RedisOptionsSource; - redisForDatabaseCache: RedisOptions & RedisOptionsSource; redisForPubsub: RedisOptions & RedisOptionsSource; redisForSystemQueue: RedisOptions & RedisOptionsSource; redisForEndedPollNotificationQueue: RedisOptions & RedisOptionsSource; @@ -253,7 +251,6 @@ export function loadConfig(): Config { dbSlaves: config.dbSlaves, meilisearch: config.meilisearch, redis, - redisForDatabaseCache: config.redisForDatabaseCache ? convertRedisOptions(config.redisForDatabaseCache, host) : redis, redisForPubsub: config.redisForPubsub ? convertRedisOptions(config.redisForPubsub, host) : redis, redisForSystemQueue: config.redisForSystemQueue ? convertRedisOptions(config.redisForSystemQueue, host) : redisForJobQueue, redisForEndedPollNotificationQueue: config.redisForEndedPollNotificationQueue ? convertRedisOptions(config.redisForEndedPollNotificationQueue, host) : redisForJobQueue, diff --git a/packages/backend/src/postgres.ts b/packages/backend/src/postgres.ts index 0552a2d878..3d665d3e44 100644 --- a/packages/backend/src/postgres.ts +++ b/packages/backend/src/postgres.ts @@ -236,13 +236,7 @@ export function createPostgresDataSource(config: Config) { } : {}), synchronize: process.env.NODE_ENV === 'test', dropSchema: process.env.NODE_ENV === 'test', - cache: !config.db.disableCache && process.env.NODE_ENV !== 'test' ? { // dbをcloseしても何故かredisのコネクションが内部的に残り続けるようで、テストの際に支障が出るため無効にする(キャッシュも含めてテストしたいため本当は有効にしたいが...) - type: 'ioredis', - options: { - ...config.redisForDatabaseCache, - keyPrefix: `${config.redisForDatabaseCache.prefix}:query:`, - }, - } : false, + cache: !config.db.disableCache && process.env.NODE_ENV !== 'test', logging: log, logger: log ? new MyCustomLogger() : undefined, maxQueryExecutionTime: 10000, // 10s