Commit 8f65da73 by Gregory Martin Committed by GitHub

Merge pull request #36 from edx/yro/set_global_timeout

Implement global timeout
parents bddc6252 83a346ca
...@@ -106,7 +106,7 @@ class VALAPICall(): ...@@ -106,7 +106,7 @@ class VALAPICall():
'password': self.auth_dict['val_password'], 'password': self.auth_dict['val_password'],
} }
r = requests.post(self.auth_dict['val_token_url'], data=payload, timeout=20) r = requests.post(self.auth_dict['val_token_url'], data=payload, timeout=self.auth_dict['global_timeout'])
if r.status_code != 200: if r.status_code != 200:
ErrorObject.print_error( ErrorObject.print_error(
...@@ -222,7 +222,7 @@ class VALAPICall(): ...@@ -222,7 +222,7 @@ class VALAPICall():
self.video_proto.val_id self.video_proto.val_id
)), )),
headers=self.headers, headers=self.headers,
timeout=20 timeout=self.auth_dict['global_timeout']
) )
if r1.status_code != 200 and r1.status_code != 404: if r1.status_code != 200 and r1.status_code != 404:
...@@ -327,7 +327,7 @@ class VALAPICall(): ...@@ -327,7 +327,7 @@ class VALAPICall():
self.auth_dict['val_api_url'] + '/', self.auth_dict['val_api_url'] + '/',
data=json.dumps(sending_data), data=json.dumps(sending_data),
headers=self.headers, headers=self.headers,
timeout=20 timeout=self.auth_dict['global_timeout']
) )
if r2.status_code > 299: if r2.status_code > 299:
...@@ -374,7 +374,7 @@ class VALAPICall(): ...@@ -374,7 +374,7 @@ class VALAPICall():
)), )),
data=json.dumps(sending_data), data=json.dumps(sending_data),
headers=self.headers, headers=self.headers,
timeout=20 timeout=self.auth_dict['global_timeout']
) )
if r4.status_code > 299: if r4.status_code > 299:
......
...@@ -166,5 +166,6 @@ val_profile_dict: ...@@ -166,5 +166,6 @@ val_profile_dict:
# Heal settings # Heal settings
heal_start: 1 heal_start: 1
heal_end: 144 heal_end: 144
global_timeout: 40
... ...
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment