add sandbox observability contracts
This commit is contained in:
parent
e9ef178b15
commit
a86e1ee8c7
6 changed files with 131 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue