refactor: Use MongoDB singleton for connection management

This commit is contained in:
kom-senapati committed 2024-10-18 09:18:15 +05:30
1 parent 7bf79675c1
commit 83f2fb1e62
6 files changed
+35 -10

No files matched your search

+2 -2
View File
@@ -1,13 +1,13 @@
import os
import datetime
from flask import Blueprint, request, send_from_directory
from pymongo import MongoClient
from core.mongo_db import MongoDB
from werkzeug.utils import secure_filename
from bson.objectid import ObjectId
from application.core.settings import settings
mongo = MongoClient(settings.MONGO_URI)
mongo = MongoDB.get_client()
db = mongo["docsgpt"]
conversations_collection = db["conversations"]
sources_collection = db["sources"]