mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-25 22:22:51 +09:00
parent
5448c22031
commit
61dcd51888
@ -8,8 +8,8 @@ const requiredMongoDBVersion = [3, 6];
|
|||||||
export function checkMongoDB(config: Config, logger: Logger) {
|
export function checkMongoDB(config: Config, logger: Logger) {
|
||||||
return new Promise((res, rej) => {
|
return new Promise((res, rej) => {
|
||||||
const mongoDBLogger = logger.createSubLogger('db');
|
const mongoDBLogger = logger.createSubLogger('db');
|
||||||
const u = config.mongodb.user.map(x => encodeURIComponent(x)).getOrElse(null);
|
const u = config.mongodb.user ? encodeURIComponent(config.mongodb.user) : null;
|
||||||
const p = config.mongodb.pass.map(x => encodeURIComponent(x)).getOrElse(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} ...`);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user