Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GS progress for push & pull #2809

Merged
merged 11 commits into from
Nov 21, 2019
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
casperdcl marked this conversation as resolved.
Show resolved Hide resolved


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

# `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 = _DEFAULT_CHUNKSIZE * multiplier
chunk_size = MIN_CHUNKSIZE * multiplier
return func(*args, chunk_size=chunk_size, **kwargs)
except requests.exceptions.ConnectionError:
multiplier //= 2
Expand Down