[fix] race condition
This commit is contained in:
parent
fb974fff1e
commit
f5d13feaf9
7 changed files with 185 additions and 63 deletions
|
|
@ -28,6 +28,21 @@ class SandboxSessionRepository(Protocol):
|
|||
def delete(self, session_id: str) -> None: ...
|
||||
|
||||
|
||||
class LockContext(Protocol):
|
||||
def __enter__(self) -> None: ...
|
||||
|
||||
def __exit__(
|
||||
self,
|
||||
exc_type: type[BaseException] | None,
|
||||
exc: BaseException | None,
|
||||
traceback: TracebackType | None,
|
||||
) -> bool | None: ...
|
||||
|
||||
|
||||
class SandboxLifecycleLocker(Protocol):
|
||||
def lock(self, chat_id: str) -> LockContext: ...
|
||||
|
||||
|
||||
class SandboxRuntime(Protocol):
|
||||
def create(
|
||||
self,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue