List sessions directly from PersistentSessionsManager
(organization_id: str)
| 105 | |
| 106 | |
| 107 | async def direct_list_sessions(organization_id: str) -> None: |
| 108 | """List sessions directly from PersistentSessionsManager""" |
| 109 | try: |
| 110 | manager = app.PERSISTENT_SESSIONS_MANAGER |
| 111 | sessions = await manager.get_active_sessions(organization_id) |
| 112 | print("\nActive browser sessions (direct):") |
| 113 | if not sessions: |
| 114 | print(" No active sessions found") |
| 115 | return |
| 116 | for session in sessions: |
| 117 | print(json.dumps(session.model_dump(), indent=2)) |
| 118 | print(" ---") |
| 119 | except Exception as e: |
| 120 | print(f"Error listing sessions directly: {str(e)}") |
| 121 | |
| 122 | |
| 123 | def print_direct_help() -> None: |
no test coverage detected