mirror of
https://iceshrimp.dev/iceshrimp/iceshrimp
synced 2024-11-25 15:46:06 +09:00
Revert "#2387"
This reverts commit 3cad494404ad0e2df2a4d42f2934640f402d1412.
This commit is contained in:
parent
f8491d479f
commit
9381435fff
13
src/index.ts
13
src/index.ts
@ -146,9 +146,22 @@ async function init(): Promise<Config> {
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// Try to connect to MongoDB
|
||||
checkMongoDb(config);
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
function checkMongoDb(config: Config) {
|
||||
const mongoDBLogger = new Logger('MongoDB');
|
||||
const u = config.mongodb.user ? encodeURIComponent(config.mongodb.user) : 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}`;
|
||||
mongoDBLogger.info(`Connecting to ${uri}`);
|
||||
require('./db/mongodb');
|
||||
mongoDBLogger.succ('Connectivity confirmed');
|
||||
}
|
||||
|
||||
function spawnWorkers(limit: number) {
|
||||
return new Promise(res => {
|
||||
// Count the machine's CPUs
|
||||
|
Loading…
Reference in New Issue
Block a user