mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-14 14:17:08 +00:00
refactor: Use MongoDB singleton for connection management
This commit is contained in:
1 parent
7bf79675c1
commit
83f2fb1e62
6 files changed
+35
-10
No files matched your search
@@ -1,10 +1,10 @@
|
||||
import sys
|
||||
from pymongo import MongoClient
|
||||
from core.mongo_db import MongoDB
|
||||
from datetime import datetime
|
||||
from application.core.settings import settings
|
||||
from application.utils import num_tokens_from_string
|
||||
|
||||
mongo = MongoClient(settings.MONGO_URI)
|
||||
mongo = MongoDB.get_client()
|
||||
db = mongo["docsgpt"]
|
||||
usage_collection = db["token_usage"]
|
||||
|
||||
|
||||
Reference in new issue
Block a user