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

Fix operations with no up or download #192

Merged
merged 2 commits into from
Jun 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions ibridges/data_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,12 +374,14 @@ def perform_operations(session: Session, operations: dict, ignore_err: bool=Fals
"""
up_sizes = [lpath.stat().st_size for lpath, _ in operations["upload"]]
down_sizes = [ipath.size for ipath, _ in operations["download"]]
pbar = tqdm(total=sum(up_sizes) + sum(down_sizes), unit="B", unit_scale=True, unit_divisor=1024)
disable = len(up_sizes) + len(down_sizes) == 0
pbar = tqdm(total=sum(up_sizes) + sum(down_sizes), unit="B", unit_scale=True, unit_divisor=1024,
disable=disable)

# For large files, the checksum computation might take too long, which can result in a timeout.
# This is why we increase the time out from file sizes > 1 GB
# This might still result in a time out if your server is very busy or a potato.
max_size = max([*up_sizes, *down_sizes])
max_size = max([*up_sizes, *down_sizes, 0])
original_timeout = session.irods_session.pool.connection_timeout
if max_size > 1e9 and original_timeout == DEFAULT_CONNECTION_TIMEOUT:
session.irods_session.pool.connection_timeout = int(
Expand Down
Loading