diff --git a/monitoring/monitorlib/infrastructure.py b/monitoring/monitorlib/infrastructure.py index 3b1f9bd0b..2c783efda 100644 --- a/monitoring/monitorlib/infrastructure.py +++ b/monitoring/monitorlib/infrastructure.py @@ -18,6 +18,7 @@ EPOCH = datetime.datetime.utcfromtimestamp(0) TOKEN_REFRESH_MARGIN = datetime.timedelta(seconds=15) +CLIENT_TIMEOUT = 60 # seconds class AuthAdapter(object): @@ -112,6 +113,7 @@ def auth( return prepared_request kwargs["auth"] = auth + kwargs["timeout"] = CLIENT_TIMEOUT return kwargs def request(self, method, url, **kwargs): @@ -166,6 +168,8 @@ def adjust_request_kwargs(self, url, method, kwargs): if method == "PUT" and kwargs.get("data"): kwargs["json"] = kwargs["data"] del kwargs["data"] + + kwargs["timeout"] = CLIENT_TIMEOUT return kwargs async def put(self, url, **kwargs):