Skip to content

Commit

Permalink
added 502 response code and exponential backoff
Browse files Browse the repository at this point in the history
  • Loading branch information
birnbaum committed Jun 11, 2020
1 parent ea7737e commit 191c438
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fs_gcsfs/_gcsfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ def __init__(self,
if self.client is None:
self.client = Client()
if retry:
adapter = HTTPAdapter(max_retries=Retry(total=retry, status_forcelist=[429, 503, 504], method_whitelist=False))
adapter = HTTPAdapter(max_retries=Retry(total=retry,
status_forcelist=[429, 502, 503, 504],
method_whitelist=False, # retry on any HTTP method
backoff_factor=0.5))
self.client._http.mount("https://", adapter)

self.bucket = self.client.bucket(self._bucket_name)
Expand Down

0 comments on commit 191c438

Please sign in to comment.