add sandbox observability contracts

This commit is contained in:
Azamat 2026-04-03 00:37:35 +03:00
parent e9ef178b15
commit a86e1ee8c7
6 changed files with 131 additions and 0 deletions

View file

@ -29,6 +29,10 @@ class InMemorySandboxSessionRepository(SandboxSessionRepository):
if session.expires_at <= now
]
def count_active(self) -> int:
with self._lock:
return len(self._sessions_by_chat_id)
def save(self, session: SandboxSession) -> None:
with self._lock:
self._sessions_by_chat_id[session.chat_id] = session