- копирую модуль upload/ из drhider (слои 1-2) - blueprint: параметр sink (drhider-сессия по умолчанию, сверка — DB+парсинг) - upload_bp: contracts_upload_sink = _store_and_parse - routes: регистрирую create_upload_refs_blueprint(cfg, sink=...) - app.py: корень репо в sys.path (для import upload) - History: план переиспользования + ревью Соннета
12 lines
312 B
Python
12 lines
312 B
Python
"""cleanup — удалить сессию."""
|
|
|
|
from .state import _sessions, _lock
|
|
|
|
|
|
def cleanup(sid: str):
|
|
"""Удалить сессию и остановить её TTL-таймер."""
|
|
with _lock:
|
|
s = _sessions.pop(sid, None)
|
|
if s and s.get("timer"):
|
|
s["timer"].cancel()
|