Skip to content

Commit

Permalink
Log connections left
Browse files Browse the repository at this point in the history
Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
  • Loading branch information
aaronchongth committed Feb 1, 2024
1 parent 5c56bbe commit 06ac547
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/api-server/api_server/routes/internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,15 @@ def __init__(self):
async def connect(self, websocket: WebSocket):
await websocket.accept()
self.active_connections.append(websocket)
logger.info(
f"ConnectionManager: {len(self.active_connections)} websocket connections still alive"
)

def disconnect(self, websocket: WebSocket):
self.active_connections.remove(websocket)
logger.info(
f"ConnectionManager: {len(self.active_connections)} websocket connections still alive"
)


connection_manager = ConnectionManager()
Expand Down

0 comments on commit 06ac547

Please sign in to comment.