mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-22 12:13:48 +01:00
設定でPostgreSQLのクエリー結果のキャッシュを無効できるように (#5046)
This commit is contained in:
parent
76bae4b28d
commit
4501f7478a
@ -62,6 +62,9 @@ db:
|
||||
user: example-misskey-user
|
||||
pass: example-misskey-pass
|
||||
|
||||
# Whether disable Caching queries
|
||||
#disableCache: true
|
||||
|
||||
# Extra Connection options
|
||||
#extra:
|
||||
# ssl: true
|
||||
|
@ -14,6 +14,7 @@ export type Source = {
|
||||
db: string;
|
||||
user: string;
|
||||
pass: string;
|
||||
disableCache?: boolean;
|
||||
extra?: { [x: string]: string };
|
||||
};
|
||||
redis: {
|
||||
|
@ -96,7 +96,7 @@ export function initDb(justBorrow = false, sync = false, log = false) {
|
||||
extra: config.db.extra,
|
||||
synchronize: process.env.NODE_ENV === 'test' || sync,
|
||||
dropSchema: process.env.NODE_ENV === 'test' && !justBorrow,
|
||||
cache: {
|
||||
cache: !config.db.disableCache ? {
|
||||
type: 'redis',
|
||||
options: {
|
||||
host: config.redis.host,
|
||||
@ -107,7 +107,7 @@ export function initDb(justBorrow = false, sync = false, log = false) {
|
||||
db: config.redis.db || 0
|
||||
}
|
||||
}
|
||||
},
|
||||
} : false,
|
||||
logging: log,
|
||||
logger: log ? new MyCustomLogger() : undefined,
|
||||
entities: [
|
||||
|
Loading…
Reference in New Issue
Block a user