refactor: migrate to typeorm 3.0 (#8443)
* wip * wip * wip * Update following.ts * wip * wip * wip * Update resolve-user.ts * maxQueryExecutionTime * wip * wip
This commit is contained in:
@ -7,7 +7,6 @@ import chalk from 'chalk';
|
||||
import chalkTemplate from 'chalk-template';
|
||||
import * as portscanner from 'portscanner';
|
||||
import semver from 'semver';
|
||||
import { getConnection } from 'typeorm';
|
||||
|
||||
import Logger from '@/services/logger.js';
|
||||
import loadConfig from '@/config/load.js';
|
||||
@ -15,7 +14,7 @@ import { Config } from '@/config/types.js';
|
||||
import { lessThan } from '@/prelude/array.js';
|
||||
import { envOption } from '../env.js';
|
||||
import { showMachineInfo } from '@/misc/show-machine-info.js';
|
||||
import { initDb } from '../db/postgre.js';
|
||||
import { db, initDb } from '../db/postgre.js';
|
||||
|
||||
const _filename = fileURLToPath(import.meta.url);
|
||||
const _dirname = dirname(_filename);
|
||||
@ -144,7 +143,7 @@ async function connectDb(): Promise<void> {
|
||||
try {
|
||||
dbLogger.info('Connecting...');
|
||||
await initDb();
|
||||
const v = await getConnection().query('SHOW server_version').then(x => x[0].server_version);
|
||||
const v = await db.query('SHOW server_version').then(x => x[0].server_version);
|
||||
dbLogger.succ(`Connected: v${v}`);
|
||||
} catch (e) {
|
||||
dbLogger.error('Cannot connect', null, true);
|
||||
|
Reference in New Issue
Block a user