Add timeouts to all s3 queries

This commit is contained in:
Colton Myers 2018-07-12 14:54:33 -06:00 committed by rallytime
parent 5391dd0a8d
commit cb654bbf2c
No known key found for this signature in database
GPG Key ID: E8F1A4B90D0DEA19

View File

@ -156,20 +156,23 @@ def query(key, keyid, method='GET', params=None, headers=None,
headers=headers,
data=data,
verify=verify_ssl,
stream=True)
stream=True,
timeout=300)
elif method == 'GET' and local_file and not return_bin:
result = requests.request(method,
requesturl,
headers=headers,
data=data,
verify=verify_ssl,
stream=True)
stream=True,
timeout=300)
else:
result = requests.request(method,
requesturl,
headers=headers,
data=data,
verify=verify_ssl)
verify=verify_ssl,
timeout=300)
finally:
if data is not None:
data.close()