mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-28 16:38:23 +01:00
Disable sql log
This commit is contained in:
parent
7945eddef6
commit
c96418806f
1 changed files with 2 additions and 4 deletions
|
@ -76,8 +76,6 @@ class MyCustomLogger implements Logger {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function initDb(justBorrow = false, sync = false, log = false) {
|
export function initDb(justBorrow = false, sync = false, log = false) {
|
||||||
const enableLogging = log || !['production', 'test'].includes(process.env.NODE_ENV || '');
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const conn = getConnection();
|
const conn = getConnection();
|
||||||
return Promise.resolve(conn);
|
return Promise.resolve(conn);
|
||||||
|
@ -92,8 +90,8 @@ export function initDb(justBorrow = false, sync = false, log = false) {
|
||||||
database: config.db.db,
|
database: config.db.db,
|
||||||
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,
|
||||||
logging: enableLogging,
|
logging: log,
|
||||||
logger: enableLogging ? new MyCustomLogger() : undefined,
|
logger: log ? new MyCustomLogger() : undefined,
|
||||||
entities: [
|
entities: [
|
||||||
Meta,
|
Meta,
|
||||||
Instance,
|
Instance,
|
||||||
|
|
Loading…
Reference in a new issue