Skip to content

Commit

Permalink
support timeout when get access token
Browse files Browse the repository at this point in the history
  • Loading branch information
qitia committed Aug 7, 2019
1 parent 429bad9 commit 16bca8a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bingads/authorization.py
Expand Up @@ -646,7 +646,8 @@ def get_access_token(**kwargs):
if 'client_secret' in kwargs and kwargs['client_secret'] is None:
del kwargs['client_secret']

r = requests.post(_UriOAuthService.AUTH_TOKEN_URI[(kwargs['environment'], kwargs['requireliveconnect'])], kwargs, verify=True)
# default timeout set to 300 secs
r = requests.post(_UriOAuthService.AUTH_TOKEN_URI[(kwargs['environment'], kwargs['requireliveconnect'])], kwargs, verify=True, timeout=300)
try:
r.raise_for_status()
except Exception:
Expand Down

0 comments on commit 16bca8a

Please sign in to comment.