From 6adc5a33fe8b488d6524ffe0a9d0bfe809dc12c0 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 21 May 2022 22:07:11 +0900 Subject: [PATCH] refactor --- packages/backend/src/db/postgre.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/backend/src/db/postgre.ts b/packages/backend/src/db/postgre.ts index eb5fc2e18..e09e93f04 100644 --- a/packages/backend/src/db/postgre.ts +++ b/packages/backend/src/db/postgre.ts @@ -5,9 +5,6 @@ pg.types.setTypeParser(20, Number); import { Logger, DataSource } from 'typeorm'; import * as highlight from 'cli-highlight'; import config from '@/config/index.js'; -import { envOption } from '../env.js'; - -import { dbLogger } from './logger.js'; import { User } from '@/models/entities/user.js'; import { DriveFile } from '@/models/entities/drive-file.js'; @@ -74,6 +71,8 @@ import { UserPending } from '@/models/entities/user-pending.js'; import { entities as charts } from '@/services/chart/entities.js'; import { Webhook } from '@/models/entities/webhook.js'; +import { envOption } from '../env.js'; +import { dbLogger } from './logger.js'; const sqlLogger = dbLogger.createSubLogger('sql', 'gray', false); @@ -212,7 +211,7 @@ export async function initDb() { if (db.isInitialized) { // nop } else { - await db.connect(); + await db.initialize(); } }