From a3dea467c373e9f4a8a5dcf61693696d98a51800 Mon Sep 17 00:00:00 2001 From: Charles Engelke Date: Thu, 6 Dec 2018 17:44:24 -0800 Subject: [PATCH] Add a default timeout of 90 (#1912) --- iap/make_iap_request.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/iap/make_iap_request.py b/iap/make_iap_request.py index 22ffc1c42204..4e93b9391d16 100644 --- a/iap/make_iap_request.py +++ b/iap/make_iap_request.py @@ -40,10 +40,15 @@ def make_iap_request(url, client_id, method='GET', **kwargs): ('GET', 'OPTIONS', 'HEAD', 'POST', 'PUT', 'PATCH', 'DELETE') **kwargs: Any of the parameters defined for the request function: https://github.com/requests/requests/blob/master/requests/api.py + If no timeout is provided, it is set to 90 by default. Returns: The page body, or raises an exception if the page couldn't be retrieved. """ + # Set the default timeout, if missing + if 'timeout' not in kwargs: + kwargs['timeout'] = 90 + # Figure out what environment we're running in and get some preliminary # information about the service account. bootstrap_credentials, _ = google.auth.default(