mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-29 08:33:20 +00:00
refactor: Use MongoDB singleton for connection management
This commit is contained in:
@@ -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