Skip to content

Commit 13ec3ac

Browse files
authored
Add timeout to refresh token calls (#192)
1 parent d53cc31 commit 13ec3ac

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

dropbox/dropbox.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,10 @@ def refresh_access_token(self, host=API_HOST, scope=None):
383383
scope = " ".join(scope)
384384
body['scope'] = scope
385385

386-
res = self._session.post(url, data=body)
386+
timeout = self._DEFAULT_TIMEOUT
387+
if self._timeout:
388+
timeout = self._timeout
389+
res = self._session.post(url, data=body, timeout=timeout)
387390
if res.status_code == 400 and res.json()['error'] == 'invalid_grant':
388391
request_id = res.headers.get('x-dropbox-request-id')
389392
err = stone_serializers.json_compat_obj_decode(

0 commit comments

Comments
 (0)