mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-22 20:23:49 +01:00
Fix DB connectivity check
This commit is contained in:
parent
234cc5e3d5
commit
487f07baf8
10
src/index.ts
10
src/index.ts
@ -14,6 +14,7 @@ import * as portscanner from 'portscanner';
|
||||
import isRoot = require('is-root');
|
||||
import Xev from 'xev';
|
||||
import * as program from 'commander';
|
||||
import mongo from './db/mongodb';
|
||||
|
||||
import Logger from './misc/logger';
|
||||
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 uri = `mongodb://${u && p ? `${u}:****@` : ''}${config.mongodb.host}:${config.mongodb.port}/${config.mongodb.db}`;
|
||||
mongoDBLogger.info(`Connecting to ${uri}`);
|
||||
require('./db/mongodb');
|
||||
mongoDBLogger.succ('Connectivity confirmed');
|
||||
|
||||
mongo.then(() => {
|
||||
mongoDBLogger.succ('Connectivity confirmed');
|
||||
})
|
||||
.catch(err => {
|
||||
mongoDBLogger.error(err.message);
|
||||
});
|
||||
}
|
||||
|
||||
function spawnWorkers(limit: number) {
|
||||
|
Loading…
Reference in New Issue
Block a user