From a8b4df6eae60cf0df36aabad22031906a3c1cdf5 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 26 Apr 2020 11:24:31 +0900 Subject: [PATCH] feat(server): Log postgresql version when boot --- src/boot/master.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/boot/master.ts b/src/boot/master.ts index f1a8b9f6a..0fcddf67d 100644 --- a/src/boot/master.ts +++ b/src/boot/master.ts @@ -3,6 +3,7 @@ import * as cluster from 'cluster'; import * as chalk from 'chalk'; import * as portscanner from 'portscanner'; import * as isRoot from 'is-root'; +import { getConnection } from 'typeorm'; import Logger from '../services/logger'; import loadConfig from '../config/load'; @@ -149,6 +150,8 @@ async function init(): Promise { try { bootLogger.info('Connecting database...'); 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) { bootLogger.error('Cannot connect to database', null, true); bootLogger.error(e);