forked from FoundKeyGang/FoundKey
設定でPostgreSQLのクエリー結果のキャッシュを無効できるように (#5046)
This commit is contained in:
parent
20630cb3a0
commit
1432a7193d
3 changed files with 6 additions and 2 deletions
|
@ -62,6 +62,9 @@ db:
|
||||||
user: example-misskey-user
|
user: example-misskey-user
|
||||||
pass: example-misskey-pass
|
pass: example-misskey-pass
|
||||||
|
|
||||||
|
# Whether disable Caching queries
|
||||||
|
#disableCache: true
|
||||||
|
|
||||||
# Extra Connection options
|
# Extra Connection options
|
||||||
#extra:
|
#extra:
|
||||||
# ssl: true
|
# ssl: true
|
||||||
|
|
|
@ -14,6 +14,7 @@ export type Source = {
|
||||||
db: string;
|
db: string;
|
||||||
user: string;
|
user: string;
|
||||||
pass: string;
|
pass: string;
|
||||||
|
disableCache?: boolean;
|
||||||
extra?: { [x: string]: string };
|
extra?: { [x: string]: string };
|
||||||
};
|
};
|
||||||
redis: {
|
redis: {
|
||||||
|
|
|
@ -96,7 +96,7 @@ export function initDb(justBorrow = false, sync = false, log = false) {
|
||||||
extra: config.db.extra,
|
extra: config.db.extra,
|
||||||
synchronize: process.env.NODE_ENV === 'test' || sync,
|
synchronize: process.env.NODE_ENV === 'test' || sync,
|
||||||
dropSchema: process.env.NODE_ENV === 'test' && !justBorrow,
|
dropSchema: process.env.NODE_ENV === 'test' && !justBorrow,
|
||||||
cache: {
|
cache: !config.db.disableCache ? {
|
||||||
type: 'redis',
|
type: 'redis',
|
||||||
options: {
|
options: {
|
||||||
host: config.redis.host,
|
host: config.redis.host,
|
||||||
|
@ -107,7 +107,7 @@ export function initDb(justBorrow = false, sync = false, log = false) {
|
||||||
db: config.redis.db || 0
|
db: config.redis.db || 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
} : false,
|
||||||
logging: log,
|
logging: log,
|
||||||
logger: log ? new MyCustomLogger() : undefined,
|
logger: log ? new MyCustomLogger() : undefined,
|
||||||
entities: [
|
entities: [
|
||||||
|
|
Loading…
Reference in a new issue