mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
back to gs multiple
Fixes https://github.com/iterative/dvc/pull/2809#discussion_r347954033
This commit is contained in:
+2
-2
@@ -17,13 +17,13 @@ from dvc.scheme import Schemes
|
||||
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.
|
||||
@@ -37,7 +37,7 @@ def dynamic_chunk_size(func):
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user