spec(backend): データベースのキャッシュにRedisの代わりにin-memoryキャッシュを使用する (MisskeyIO#416)
This commit is contained in:
parent
de54df9cd7
commit
37f34bccf3
|
@ -46,7 +46,6 @@ type Source = {
|
||||||
pass: string;
|
pass: string;
|
||||||
}[];
|
}[];
|
||||||
redis: RedisOptionsSource;
|
redis: RedisOptionsSource;
|
||||||
redisForDatabaseCache?: RedisOptionsSource;
|
|
||||||
redisForPubsub?: RedisOptionsSource;
|
redisForPubsub?: RedisOptionsSource;
|
||||||
redisForJobQueue?: RedisOptionsSource;
|
redisForJobQueue?: RedisOptionsSource;
|
||||||
redisForSystemQueue?: RedisOptionsSource;
|
redisForSystemQueue?: RedisOptionsSource;
|
||||||
|
@ -177,7 +176,6 @@ export type Config = {
|
||||||
externalMediaProxyEnabled: boolean;
|
externalMediaProxyEnabled: boolean;
|
||||||
videoThumbnailGenerator: string | null;
|
videoThumbnailGenerator: string | null;
|
||||||
redis: RedisOptions & RedisOptionsSource;
|
redis: RedisOptions & RedisOptionsSource;
|
||||||
redisForDatabaseCache: RedisOptions & RedisOptionsSource;
|
|
||||||
redisForPubsub: RedisOptions & RedisOptionsSource;
|
redisForPubsub: RedisOptions & RedisOptionsSource;
|
||||||
redisForSystemQueue: RedisOptions & RedisOptionsSource;
|
redisForSystemQueue: RedisOptions & RedisOptionsSource;
|
||||||
redisForEndedPollNotificationQueue: RedisOptions & RedisOptionsSource;
|
redisForEndedPollNotificationQueue: RedisOptions & RedisOptionsSource;
|
||||||
|
@ -253,7 +251,6 @@ export function loadConfig(): Config {
|
||||||
dbSlaves: config.dbSlaves,
|
dbSlaves: config.dbSlaves,
|
||||||
meilisearch: config.meilisearch,
|
meilisearch: config.meilisearch,
|
||||||
redis,
|
redis,
|
||||||
redisForDatabaseCache: config.redisForDatabaseCache ? convertRedisOptions(config.redisForDatabaseCache, host) : redis,
|
|
||||||
redisForPubsub: config.redisForPubsub ? convertRedisOptions(config.redisForPubsub, host) : redis,
|
redisForPubsub: config.redisForPubsub ? convertRedisOptions(config.redisForPubsub, host) : redis,
|
||||||
redisForSystemQueue: config.redisForSystemQueue ? convertRedisOptions(config.redisForSystemQueue, host) : redisForJobQueue,
|
redisForSystemQueue: config.redisForSystemQueue ? convertRedisOptions(config.redisForSystemQueue, host) : redisForJobQueue,
|
||||||
redisForEndedPollNotificationQueue: config.redisForEndedPollNotificationQueue ? convertRedisOptions(config.redisForEndedPollNotificationQueue, host) : redisForJobQueue,
|
redisForEndedPollNotificationQueue: config.redisForEndedPollNotificationQueue ? convertRedisOptions(config.redisForEndedPollNotificationQueue, host) : redisForJobQueue,
|
||||||
|
|
|
@ -236,13 +236,7 @@ export function createPostgresDataSource(config: Config) {
|
||||||
} : {}),
|
} : {}),
|
||||||
synchronize: process.env.NODE_ENV === 'test',
|
synchronize: process.env.NODE_ENV === 'test',
|
||||||
dropSchema: process.env.NODE_ENV === 'test',
|
dropSchema: process.env.NODE_ENV === 'test',
|
||||||
cache: !config.db.disableCache && process.env.NODE_ENV !== 'test' ? { // dbをcloseしても何故かredisのコネクションが内部的に残り続けるようで、テストの際に支障が出るため無効にする(キャッシュも含めてテストしたいため本当は有効にしたいが...)
|
cache: !config.db.disableCache && process.env.NODE_ENV !== 'test',
|
||||||
type: 'ioredis',
|
|
||||||
options: {
|
|
||||||
...config.redisForDatabaseCache,
|
|
||||||
keyPrefix: `${config.redisForDatabaseCache.prefix}:query:`,
|
|
||||||
},
|
|
||||||
} : false,
|
|
||||||
logging: log,
|
logging: log,
|
||||||
logger: log ? new MyCustomLogger() : undefined,
|
logger: log ? new MyCustomLogger() : undefined,
|
||||||
maxQueryExecutionTime: 10000, // 10s
|
maxQueryExecutionTime: 10000, // 10s
|
||||||
|
|
Loading…
Reference in a new issue