Skip to content

Commit

Permalink
removing remnants of timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
LordFarquaadtheCreator committed Jun 26, 2024
1 parent b720dc0 commit 9a4b7b7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 1 addition & 1 deletion database/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import client from './db.config';
// if no connection can be made, return null
const getDB = async () => {
console.log("Connecting to Database ...");
if(client._connected) return client;
if(client._connected || client._connecting) return client;
try{
await client.connect()
console.log("Connected to Database");
Expand Down
3 changes: 0 additions & 3 deletions server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,12 @@ import fs from 'fs';
// const credentials = {key: privateKey, cert: certificate};

const PORT = 3000;
// const INTERVAL = secondsToMs(10); // 1 hr
// const TIMEOUT = secondsToMs(10);
const app = express();
let dbAval: boolean = true;

// initial check
(async () => {
try {
// logger.info(`Please wait ${TIMEOUT / 1000}s for the database to connect`);
dbAval = await checkDB();
logger.info(`Server is up, database is ${dbAval ? "up" : "not up"}`);
} catch (e: any) {
Expand Down

0 comments on commit 9a4b7b7

Please sign in to comment.