Remove VM upload layer; keep file picker only

This commit is contained in:
“Naeel”
2026-09-05 09:23:13 +03:00
parent c0b87880ae
commit 85605fe8c6
20 changed files with 1 additions and 405 deletions
-37
View File
@@ -1,37 +0,0 @@
"""Общее состояние сессий, блокировка, лимиты и TTL."""
import threading
TTL_SECONDS = 30 * 60
MAX_FILE_BYTES = 50 * 1024 * 1024
MAX_SESSION_BYTES = 500 * 1024 * 1024
_sessions: dict = {}
_lock = threading.Lock()
def _start_timer(sid: str) -> threading.Timer:
"""Запустить таймер автоочистки сессии через TTL."""
def _clean():
with _lock:
_sessions.pop(sid, None)
timer = threading.Timer(TTL_SECONDS, _clean)
timer.daemon = True
timer.start()
return timer
def configure(max_file_bytes: int = None, max_session_bytes: int = None,
ttl_seconds: int = None):
"""Переопределить лимиты и TTL из конфигурации приложения."""
global MAX_FILE_BYTES, MAX_SESSION_BYTES, TTL_SECONDS
if max_file_bytes is not None:
MAX_FILE_BYTES = max_file_bytes
if max_session_bytes is not None:
MAX_SESSION_BYTES = max_session_bytes
if ttl_seconds is not None:
TTL_SECONDS = ttl_seconds