Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
hub
/
github.com/AstrBotDevs/AstrBot
/ acquire_lock
Method
acquire_lock
astrbot/core/utils/session_lock.py:49–52 ·
view source on GitHub ↗
(self, session_id: str)
Source
from the content-addressed store, hash-verified
47
48
@asynccontextmanager
49
async
def
acquire_lock(self, session_id: str):
50
manager = self._get_loop_manager()
51
async
with
manager.acquire_lock(session_id):
52
yield
53
54
55
session_lock_manager = SessionLockManager()
Callers
15
test_acquire_release_lock
Method · 0.95
test_lock_is_reusable
Method · 0.95
test_access_after_loop_close_in_new_loop_works
Method · 0.95
test_empty_session_id
Method · 0.95
test_special_characters_in_session_id
Method · 0.95
test_very_long_session_id
Method · 0.95
test_lock_not_held_after_context_exit
Method · 0.95
test_exception_during_lock
Method · 0.95
test_nested_lock_different_sessions
Method · 0.95
process
Method · 0.45
acquire_in_loop
Method · 0.45
task1
Method · 0.45
Calls
1
_get_loop_manager
Method · 0.95
Tested by
15
test_acquire_release_lock
Method · 0.76
test_lock_is_reusable
Method · 0.76
test_access_after_loop_close_in_new_loop_works
Method · 0.76
test_empty_session_id
Method · 0.76
test_special_characters_in_session_id
Method · 0.76
test_very_long_session_id
Method · 0.76
test_lock_not_held_after_context_exit
Method · 0.76
test_exception_during_lock
Method · 0.76
test_nested_lock_different_sessions
Method · 0.76
acquire_in_loop
Method · 0.36
task1
Method · 0.36
task2
Method · 0.36