Skip to content

Commit

Permalink
Bug fix for slice size default
Browse files Browse the repository at this point in the history
  • Loading branch information
afoix committed Aug 31, 2021
1 parent e94a5a5 commit dfd9be4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyega3/libs/data_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def download_file(self, output_file, num_connections=1, max_slice_size=DEFAULT_S
if file_size < 100 * 1024 * 1024:
num_connections = 1

logging.info(f"Download starting [using {num_connections} connection(s)]...")
logging.info(f"Download starting [using {num_connections} connection(s), file size {file_size} and chunk length {max_slice_size}]...")

chunk_len = max_slice_size

Expand Down
3 changes: 2 additions & 1 deletion pyega3/pyega3.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from libs.data_set import DataSet
from libs.server_config import ServerConfig
from libs.utils import get_client_ip
from libs.data_file import DataFile

version = "3.4.1"
session_id = random.getrandbits(32)
Expand All @@ -32,7 +33,7 @@ def main():
parser.add_argument("-c", "--connections", type=int, default=1,
help="Download using specified number of connections (default: 1 connection)")
parser.add_argument("-t", "--test", action="store_true", help="Test user activated")
parser.add_argument("-ms", "--max-slice-size", type=int, default=None,
parser.add_argument("-ms", "--max-slice-size", type=int, default=DataFile.DEFAULT_SLICE_SIZE,
help="Set maximum size for each slice in bytes (default: 100 MB)")

subparsers = parser.add_subparsers(dest="subcommand", help="subcommands")
Expand Down

0 comments on commit dfd9be4

Please sign in to comment.