Skip to content

Commit

Permalink
Removed extra code in connectDB causing connection issues
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanC112 committed Jun 4, 2024
1 parent 3822fb3 commit d3e25ce
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions connectDB.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
import getDB from "./db";
import logger from "./utils/logger";

let isActive = false;

const connectDB = async (req: any, res: any, next: any) => {
try {
if (isActive) {
logger.info("Database already connected");
return next();
}
req.client = await getDB();
isActive = true;
next();
} catch (err: any) {
logger.info(err.message);
Expand Down

0 comments on commit d3e25ce

Please sign in to comment.