test failed mongo connection
This commit is contained in:
1 file changed
+2
-6
@@ -24,7 +24,7 @@ class QuarksBot extends Client {
|
|||||||
|
|
||||||
this.db;
|
this.db;
|
||||||
this.dbo;
|
this.dbo;
|
||||||
this.connectDB(this.config.mongoURI, this.config.dbo);
|
this.connectMongo(this.config.mongoURI, this.config.dbo);
|
||||||
this.LoadCommands();
|
this.LoadCommands();
|
||||||
this.LoadEvents();
|
this.LoadEvents();
|
||||||
|
|
||||||
@@ -69,14 +69,10 @@ class QuarksBot extends Client {
|
|||||||
const client = this;
|
const client = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
async connectDB(mongoURI, dbo) {
|
|
||||||
await this.connectMongo(mongoURI, dbo)
|
|
||||||
}
|
|
||||||
|
|
||||||
async connectMongo(mongoURI, dbo) {
|
async connectMongo(mongoURI, dbo) {
|
||||||
try {
|
try {
|
||||||
// Connect to MongoDB database.
|
// Connect to MongoDB database.
|
||||||
this.db = await MongoClient.connect(mongoURI);
|
this.db = await MongoClient.connect(mongoURI, {connectTimeoutMS: 5000});
|
||||||
this.dbo = this.db.db(dbo);
|
this.dbo = this.db.db(dbo);
|
||||||
mongoose.connect(`${mongoURI}/${dbo}`);
|
mongoose.connect(`${mongoURI}/${dbo}`);
|
||||||
this.log('Successfully connected to mongoDB');
|
this.log('Successfully connected to mongoDB');
|
||||||
|
|||||||
Reference in new issue
Block a user