初始化全局匿名会话池。
(
pool_size: int = 3,
)
| 620 | |
| 621 | |
| 622 | async def initialize_guest_session_pool( |
| 623 | pool_size: int = 3, |
| 624 | ) -> GuestSessionPool: |
| 625 | """初始化全局匿名会话池。""" |
| 626 | global _guest_session_pool |
| 627 | |
| 628 | with _guest_pool_lock: |
| 629 | if _guest_session_pool is None: |
| 630 | _guest_session_pool = GuestSessionPool(pool_size=pool_size) |
| 631 | pool = _guest_session_pool |
| 632 | |
| 633 | await pool.initialize() |
| 634 | return pool |
| 635 | |
| 636 | |
| 637 | async def close_guest_session_pool(): |
no test coverage detected