Skip to content

Commit

Permalink
back to gs multiple
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl committed Nov 19, 2019
1 parent eb5a0a9 commit 5eefacd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dvc/remote/gs.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
from dvc.utils.compat import FileNotFoundError # skipcq: PYL-W0622

logger = logging.getLogger(__name__)
MIN_CHUNKSIZE = 256 * 1024


def dynamic_chunk_size(func):
@wraps(func)
def wrapper(*args, **kwargs):
import requests
from google.cloud.storage.blob import Blob

# `ConnectionError` may be due to too large `chunk_size`
# (see [#2572]) so try halving on error.
Expand All @@ -37,7 +37,7 @@ def wrapper(*args, **kwargs):
while True:
try:
# skipcq: PYL-W0212
chunk_size = MIN_CHUNKSIZE * multiplier
chunk_size = Blob._CHUNK_SIZE_MULTIPLE * multiplier
return func(*args, chunk_size=chunk_size, **kwargs)
except requests.exceptions.ConnectionError:
multiplier //= 2
Expand Down

0 comments on commit 5eefacd

Please sign in to comment.