From 5443ca9ae4cd4a76320e5dde51dae40bff1cafc9 Mon Sep 17 00:00:00 2001 From: nnayk <79224511+nnayk@users.noreply.github.com> Date: Thu, 7 Dec 2023 22:55:17 -0800 Subject: [PATCH] Remove db lock --- Backend/db_access.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Backend/db_access.py b/Backend/db_access.py index f0f3d93..bf97958 100644 --- a/Backend/db_access.py +++ b/Backend/db_access.py @@ -21,17 +21,15 @@ load_dotenv() app = Flask(__name__) -db_lock = 0 +# db_lock = 0 @app.before_request def db_connect(DB_URL=None): - if not db_lock: - # MongoDB connection - mongo_uri = DB_URL or os.environ.get("MONGO_URI") - connect(alias="default", host=mongo_uri) - db_lock = 1 - return True + # MongoDB connection + mongo_uri = DB_URL or os.environ.get("MONGO_URI") + connect(alias="default", host=mongo_uri) + return True class Response: