From 6a3a7edb71b80cb03611ac36fe13e013075315ba Mon Sep 17 00:00:00 2001 From: Toast <96593068+AnxietyisReal@users.noreply.github.com> Date: Tue, 29 Aug 2023 02:37:16 +1000 Subject: [PATCH] Remove `reconnected` event Seems entirely useless and both events just emits at once (reconnected and connected) when it loses connection to the database --- src/funcs/DatabaseServer.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/funcs/DatabaseServer.ts b/src/funcs/DatabaseServer.ts index 1eeaf12..75a4886 100644 --- a/src/funcs/DatabaseServer.ts +++ b/src/funcs/DatabaseServer.ts @@ -24,7 +24,6 @@ export default async(client:TClient)=>{ .on('disconnecting', ()=>console.log(client.logTime(), `${LogPrefix} Disconnecting from MongoDB`)) .on('disconnected', ()=>console.log(client.logTime(), `${LogPrefix} Disconnected from MongoDB`)) .on('close', ()=>console.log(client.logTime(), `${LogPrefix} MongoDB has closed the connection`)) - .on('reconnected', ()=>console.log(client.logTime(), `${LogPrefix} Connection to MongoDB has been re-established`)) .on('all', ()=>console.log(client.logTime(), `${LogPrefix} Successfully established a connection to all members`)) .on('fullsetup', ()=>console.log(client.logTime(), `${LogPrefix} Successfully established a connection to Primary server & atleast one member`)) .on('error', ((err:mongoose.Error)=>console.error(client.logTime(), `${LogPrefix} Encountered an error in MongoDB: ${err.message}`)));