mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-10-16 13:38:07 -07:00
[test:websockets] Update server hang workaround (#17718)
Authored by: doe1080
This commit is contained in:
@@ -130,7 +130,11 @@ def ws_validate_and_send(rh, req):
|
||||
try:
|
||||
return rh.send(req)
|
||||
except TransportError as e:
|
||||
if i < (max_tries - 1) and 'connection closed during handshake' in str(e):
|
||||
if i < (max_tries - 1) and (
|
||||
'connection closed during handshake' in str(e)
|
||||
or (isinstance(e.cause, websockets.exceptions.InvalidMessage)
|
||||
and isinstance(e.cause.__cause__, EOFError))
|
||||
):
|
||||
# websockets server sometimes hangs on new connections
|
||||
continue
|
||||
raise
|
||||
|
||||
Reference in New Issue
Block a user