From c349a3df8e6e5117f2aa55650e989799126de0e6 Mon Sep 17 00:00:00 2001 From: Romuald Juchnowicz-Bierbasz Date: Fri, 10 May 2019 13:56:53 +0200 Subject: [PATCH] Add timeout --- src/galaxy/http.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/galaxy/http.py b/src/galaxy/http.py index 7973e64..1e6ec82 100644 --- a/src/galaxy/http.py +++ b/src/galaxy/http.py @@ -11,10 +11,10 @@ from galaxy.api.errors import ( ) class AuthenticatedHttpClient: - def __init__(self, limit=20): # TODO timeout? + def __init__(self, limit=20, timeout=aiohttp.ClientTimeout(total=60)): ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) ssl_context.load_verify_locations(certifi.where()) - connector = aiohttp.TCPConnector(limit=limit, ssl=ssl_context) + connector = aiohttp.TCPConnector(limit=limit, timeout=timeout, ssl=ssl_context) self._session = aiohttp.ClientSession(connector=connector) async def close(self):