Bug 1339592 - Increase timeout for SETA api; r=jmaher

MozReview-Commit-ID: JSIg3vER0AE

--HG--
extra : rebase_source : 18476916bb3d9d3720c5b9117c9aee2f4c115015
This commit is contained in:
Rob Wood 2017-02-15 08:19:56 -05:00
Родитель 8b63561ce3
Коммит 0f7149f735
1 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -54,7 +54,7 @@ class SETA(object):
logger.debug("Retrieving low-value jobs list from SETA")
response = retry(requests.get, attempts=2, sleeptime=10,
args=(url, ),
kwargs={'timeout': 5, 'headers': ''})
kwargs={'timeout': 60, 'headers': ''})
task_list = json.loads(response.content).get('jobtypes', '')
if type(task_list) == dict and len(task_list) > 0:
@ -70,12 +70,12 @@ class SETA(object):
# In the event of request times out, requests will raise a TimeoutError.
except exceptions.Timeout:
logger.warning("SETA server is timeout, we will treat all test tasks as high value.")
logger.warning("SETA timeout, we will treat all test tasks as high value.")
# In the event of a network problem (e.g. DNS failure, refused connection, etc),
# requests will raise a ConnectionError.
except exceptions.ConnectionError:
logger.warning("SETA server is timeout, we will treat all test tasks as high value.")
logger.warning("SETA connection error, we will treat all test tasks as high value.")
# In the event of the rare invalid HTTP response(e.g 404, 401),
# requests will raise an HTTPError exception
@ -120,7 +120,7 @@ class SETA(object):
try:
response = retry(requests.get, attempts=2, sleeptime=10,
args=(url, ),
kwargs={'timeout': 5, 'headers': {'User-Agent': 'TaskCluster'}})
kwargs={'timeout': 60, 'headers': {'User-Agent': 'TaskCluster'}})
prev_push_date = json.loads(response.content).get(str(prev_push_id), {}).get('date', 0)
# cache it for next time