Implement reusable upload platform

This commit is contained in:
“Naeel”
2026-09-05 08:51:32 +03:00
parent 82d9ca9136
commit c0b87880ae
35 changed files with 734 additions and 9 deletions
+19
View File
@@ -0,0 +1,19 @@
"""Создание сессии."""
import threading
import uuid
from .state import _lock, _sessions, _start_timer
def create_session() -> str:
"""Создать сессию и вернуть её уникальный идентификатор."""
sid = uuid.uuid4().hex
with _lock:
_sessions[sid] = {
"files": [],
"timer": _start_timer(sid),
"cancel": threading.Event(),
}
return sid