mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-23 04:33:50 +01:00
This commit is contained in:
parent
13a9dd642b
commit
f8491d479f
13
src/index.ts
13
src/index.ts
@ -146,22 +146,9 @@ async function init(): Promise<Config> {
|
|||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try to connect to MongoDB
|
|
||||||
checkMongoDb(config);
|
|
||||||
|
|
||||||
return 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) {
|
function spawnWorkers(limit: number) {
|
||||||
return new Promise(res => {
|
return new Promise(res => {
|
||||||
// Count the machine's CPUs
|
// Count the machine's CPUs
|
||||||
|
Loading…
Reference in New Issue
Block a user