mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-14 22:17:30 -07:00
Merge pull request #2388 from mei23/mei-0822-dbcheck
起動時のDB接続チェックでエラーを検出できないのを修正
This commit is contained in:
commit
1f11befc24
1 changed files with 8 additions and 2 deletions
|
@ -14,6 +14,7 @@ import * as portscanner from 'portscanner';
|
||||||
import isRoot = require('is-root');
|
import isRoot = require('is-root');
|
||||||
import Xev from 'xev';
|
import Xev from 'xev';
|
||||||
import * as program from 'commander';
|
import * as program from 'commander';
|
||||||
|
import mongo from './db/mongodb';
|
||||||
|
|
||||||
import Logger from './misc/logger';
|
import Logger from './misc/logger';
|
||||||
import ProgressBar from './misc/cli/progressbar';
|
import ProgressBar from './misc/cli/progressbar';
|
||||||
|
@ -158,8 +159,13 @@ function checkMongoDb(config: Config) {
|
||||||
const p = config.mongodb.pass ? encodeURIComponent(config.mongodb.pass) : null;
|
const p = config.mongodb.pass ? encodeURIComponent(config.mongodb.pass) : null;
|
||||||
const uri = `mongodb://${u && p ? `${u}:****@` : ''}${config.mongodb.host}:${config.mongodb.port}/${config.mongodb.db}`;
|
const uri = `mongodb://${u && p ? `${u}:****@` : ''}${config.mongodb.host}:${config.mongodb.port}/${config.mongodb.db}`;
|
||||||
mongoDBLogger.info(`Connecting to ${uri}`);
|
mongoDBLogger.info(`Connecting to ${uri}`);
|
||||||
require('./db/mongodb');
|
|
||||||
|
mongo.then(() => {
|
||||||
mongoDBLogger.succ('Connectivity confirmed');
|
mongoDBLogger.succ('Connectivity confirmed');
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
mongoDBLogger.error(err.message);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function spawnWorkers(limit: number) {
|
function spawnWorkers(limit: number) {
|
||||||
|
|
Loading…
Reference in a new issue