22 lines
562 B
Python
22 lines
562 B
Python
import threading
|
|
from minio import Minio
|
|
from app.config import S3_ENDPOINT, S3_ACCESS_KEY_ID, S3_SECRET_ACCESS_KEY, S3_BUCKET
|
|
|
|
users_lock = threading.Lock()
|
|
messages_lock = threading.Lock()
|
|
|
|
users_by_id: dict[str, dict] = {}
|
|
users_by_username: dict[str, dict] = {}
|
|
chats_by_id: dict[str, dict] = {}
|
|
messages_by_chat: dict[str, list[dict]] = {}
|
|
|
|
endpoint = S3_ENDPOINT.replace("http://", "").replace("https://", "")
|
|
|
|
minio_client = Minio(
|
|
endpoint,
|
|
access_key=S3_ACCESS_KEY_ID,
|
|
secret_key=S3_SECRET_ACCESS_KEY,
|
|
secure=False,
|
|
)
|
|
|
|
BUCKET = S3_BUCKET |