File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -173,13 +173,15 @@ async def event_stream(websocket: WebSocket, uuid: str):
173173 message_body = await reader
174174 _LOGGER .debug ("Got message for %s (message_body=%s)" , es_id , message_body )
175175 if message_body == b"POISON" :
176- _LOGGER .debug ("Got poison pill for %s (%s) (closing)..." , es_id , uuid )
176+ _LOGGER .debug ("Taking POISON for %s (%s) (closing)..." , es_id , uuid )
177177 _running = False
178178 else :
179179 await websocket .send_text (str (message_body ))
180180
181181 _LOGGER .debug ("Closing %s (uuid=%s)..." , es_id , uuid )
182- await websocket .close ()
182+ await websocket .close (
183+ code = status .WS_1000_NORMAL_CLOSURE , reason = "The stream has been deleted"
184+ )
183185 _LOGGER .debug ("Closed %s" , es_id )
184186
185187
You can’t perform that action at this time.
0 commit comments