mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-13 13:37:31 -07:00
feat(server): Log postgresql version when boot
This commit is contained in:
parent
5583007adb
commit
5ad96320d7
1 changed files with 3 additions and 0 deletions
|
@ -3,6 +3,7 @@ import * as cluster from 'cluster';
|
||||||
import * as chalk from 'chalk';
|
import * as chalk from 'chalk';
|
||||||
import * as portscanner from 'portscanner';
|
import * as portscanner from 'portscanner';
|
||||||
import * as isRoot from 'is-root';
|
import * as isRoot from 'is-root';
|
||||||
|
import { getConnection } from 'typeorm';
|
||||||
|
|
||||||
import Logger from '../services/logger';
|
import Logger from '../services/logger';
|
||||||
import loadConfig from '../config/load';
|
import loadConfig from '../config/load';
|
||||||
|
@ -149,6 +150,8 @@ async function init(): Promise<Config> {
|
||||||
try {
|
try {
|
||||||
bootLogger.info('Connecting database...');
|
bootLogger.info('Connecting database...');
|
||||||
await initDb();
|
await initDb();
|
||||||
|
const v = await getConnection().query('SHOW server_version').then(x => x[0].server_version)
|
||||||
|
bootLogger.succ(`Connected to database: v${v}`);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
bootLogger.error('Cannot connect to database', null, true);
|
bootLogger.error('Cannot connect to database', null, true);
|
||||||
bootLogger.error(e);
|
bootLogger.error(e);
|
||||||
|
|
Loading…
Reference in a new issue