Added db_client_sync

This commit is contained in:
Profitroll 2023-08-14 13:51:18 +02:00
parent a1acaed6dd
commit 7011baff0f
Signed by: profitroll
GPG Key ID: FA35CAB49DACD3B2
1 changed files with 3 additions and 2 deletions

View File

@ -1,5 +1,5 @@
from async_pymongo import AsyncClient
from pymongo import GEOSPHERE
from pymongo import GEOSPHERE, MongoClient
from modules.utils import configGet
@ -19,6 +19,7 @@ else:
)
db_client = AsyncClient(con_string)
db_client_sync = MongoClient(con_string)
db = db_client.get_database(name=db_config["name"])
@ -29,4 +30,4 @@ col_videos = db.get_collection("videos")
col_tokens = db.get_collection("tokens")
col_emails = db.get_collection("emails")
col_photos.create_index([("location", GEOSPHERE)])
db_client_sync[db_config["name"]]["photos"].create_index([("location", GEOSPHERE)])