@@ -95,7 +95,8 @@ async def broadcast(self, message: Union[str, dict, list]) -> None:
95
95
await websocket .close ()
96
96
logger .warning (
97
97
f'Failed to send message: "{ message } "'
98
- f' to websocket: "{ websocket } ", connection closed."' )
98
+ f' to websocket: "{ websocket } ", connection closed."'
99
+ )
99
100
except RuntimeError as e :
100
101
logger .warning (
101
102
f'Failed to send: "{ message } " to websocket: "{ websocket } ."' ,
@@ -112,7 +113,7 @@ async def received_message(self, websocket: WebSocket, message: str) -> None:
112
113
websocket = websocket , message = INVALID_JSON_ERROR_STR
113
114
)
114
115
115
- async def relay_video_frames (self , connection : WebSocketConnection ):
116
+ async def relay_video_frames (self , connection : WebSocketConnection ) -> None :
116
117
if connection .type == WebSocketTypeEnum .VIDEO :
117
118
websocket = connection .websocket
118
119
try :
@@ -131,10 +132,10 @@ async def relay_video_frames(self, connection: WebSocketConnection):
131
132
logger .error (f"Failed with { e } " )
132
133
finally :
133
134
await websocket .close ()
134
- self .active_connections . remove (connection )
135
+ self .disconnect (connection )
135
136
else :
136
137
logger .error (
137
- f'Excpected websocket connection of type { WebSocketTypeEnum .VIDEO } '
138
+ f"Expected websocket connection of type { WebSocketTypeEnum .VIDEO } "
138
139
)
139
140
140
141
# Note: Currently we only support one message handler per type, registering the
0 commit comments