1
0
mirror of https://github.com/MisskeyIO/misskey synced 2024-11-28 06:48:32 +09:00

Disable sql log

This commit is contained in:
syuilo 2019-04-17 16:45:31 +09:00
parent 7945eddef6
commit c96418806f
No known key found for this signature in database
GPG Key ID: BDC4C49D06AB9D69

View File

@ -76,8 +76,6 @@ class MyCustomLogger implements Logger {
}
export function initDb(justBorrow = false, sync = false, log = false) {
const enableLogging = log || !['production', 'test'].includes(process.env.NODE_ENV || '');
try {
const conn = getConnection();
return Promise.resolve(conn);
@ -92,8 +90,8 @@ export function initDb(justBorrow = false, sync = false, log = false) {
database: config.db.db,
synchronize: process.env.NODE_ENV === 'test' || sync,
dropSchema: process.env.NODE_ENV === 'test' && !justBorrow,
logging: enableLogging,
logger: enableLogging ? new MyCustomLogger() : undefined,
logging: log,
logger: log ? new MyCustomLogger() : undefined,
entities: [
Meta,
Instance,