Skip to content

Commit fad72ab

Browse files
ganisbackyuvipanda
authored andcommitted
close connection after 2 hour
1 parent 38b2c69 commit fad72ab

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

jupyter_server_proxy/handlers.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ async def proxy(self, host, port, proxied_path):
374374
force_instance=True, resolver=UnixResolver(self.unix_socket)
375375
)
376376
else:
377-
client = httpclient.AsyncHTTPClient()
377+
client = httpclient.AsyncHTTPClient(force_instance=True)
378378
# check if the request is stream request
379379
accept_header = self.request.headers.get('Accept')
380380
if accept_header == 'text/event-stream':
@@ -425,7 +425,8 @@ def streaming_callback(chunk):
425425
header_callback=header_callback)
426426

427427
# no timeout for stream api
428-
req.request_timeout = 0
428+
req.request_timeout = 7200
429+
req.connect_timeout = 600
429430

430431
try:
431432
response = await client.fetch(req, raise_error=False)

0 commit comments

Comments
 (0)