Skip to content

Commit

Permalink
Fix operations with no up or download (#192)
Browse files Browse the repository at this point in the history
* Fix operations with no up or download

* Placate pylint
  • Loading branch information
qubixes authored Jun 17, 2024
1 parent 9ff0d55 commit f53f70e
Showing 1 changed file with 4 additions and 2 deletions.
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

0 comments on commit f53f70e

Please sign in to comment.