bump some timeouts

This commit is contained in:
coletdjnz 2024-07-14 13:06:50 +12:00
parent 34ef90d1ba
commit bcf8436c68
No known key found for this signature in database
GPG Key ID: 91984263BB39894A
2 changed files with 3 additions and 3 deletions

View File

@ -163,7 +163,7 @@ def handle(self):
protocol = websockets.ServerProtocol() protocol = websockets.ServerProtocol()
connection = websockets.sync.server.ServerConnection(socket=self.request, protocol=protocol, close_timeout=10) connection = websockets.sync.server.ServerConnection(socket=self.request, protocol=protocol, close_timeout=10)
try: try:
connection.handshake() connection.handshake(timeout=5.0)
for message in connection: for message in connection:
if message == 'proxy_info': if message == 'proxy_info':
connection.send(json.dumps(self.proxy_info)) connection.send(json.dumps(self.proxy_info))
@ -256,7 +256,7 @@ class HTTPProxyTestContext(abc.ABC):
def http_server(self, server_class, *args, **kwargs): def http_server(self, server_class, *args, **kwargs):
server = proxy_server(server_class, self.REQUEST_HANDLER_CLASS, *args, **kwargs) server = proxy_server(server_class, self.REQUEST_HANDLER_CLASS, *args, **kwargs)
time.sleep(1) # ensure server is up time.sleep(1)
return server return server
@abc.abstractmethod @abc.abstractmethod

View File

@ -227,7 +227,7 @@ def _send(self, request):
open_timeout=timeout, open_timeout=timeout,
user_agent_header=None, user_agent_header=None,
ssl_context=ssl_context, ssl_context=ssl_context,
close_timeout=0, # not ideal, but prevents yt-dlp hanging close_timeout=0.1, # not ideal, but prevents yt-dlp hanging
) )
return WebsocketsResponseAdapter(conn, url=request.url) return WebsocketsResponseAdapter(conn, url=request.url)