Skip to content

Commit

Permalink
263 timeout (#264)
Browse files Browse the repository at this point in the history
* Fixing connection_timeout

* Fixing error messagewq

* pylint

* Skip too high value check and keep int check

* try catch conversion to int

* fix pylint too many pos args

---------

Co-authored-by: Staiger, Christine <christine.staiger@wur.nl>
  • Loading branch information
chStaiger and Staiger, Christine authored Sep 24, 2024
1 parent 444f56c commit 70b0602
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
6 changes: 5 additions & 1 deletion docs/source/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,8 @@ This error is most likely to happen if you try to transfer a large file. The def
which translates to roughly 7 hours. This should not cause issues during the actual transfer. However, if the calculation
of the checksum takes more than 7 hours (if the iRODS server is busy for example, or the file is many terabytes), then
you will get a network error. The checksum itself should still be created. You can increase the timeout in your `irods_environment.json`
file by adding a new entry with :code:`"connection_timeout": 99999999999,`.
file by adding a new entry with :code:`"connection_timeout": <time in seconds>,`.

Note, that the **maximum number equals to 292 years**, i.e. `"connection_timeout": 9208512000,`.


6 changes: 4 additions & 2 deletions ibridges/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,10 @@ def __init__(
f"Error reading environment file '{irods_env_path}': "
f"expected dictionary, got {type(irods_env)}."
)

self.connection_timeout = irods_env.pop("connection_timeout", 25000)
try:
self.connection_timeout = int(irods_env.pop("connection_timeout", 25000))
except TypeError as err:
raise ValueError("'connection_timeout' in irods_environment must be integer.") from err

self._password = password
self._irods_env: dict = irods_env
Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ module = [
ignore_missing_imports = true

[tool.pylint.'MASTER']
ignore-patterns="_version.py"
ignore-patterns="_version.py"

[tool.pylint.'BASIC']
good-names=["e", "f", "m"]
Expand All @@ -79,6 +79,9 @@ max-line-length=100
max-locals=35
max-args=10

[tool.pylint.'MESSAGES CONTROL']
disable="too-many-positional-arguments"

[tool.ruff]
exclude = ["_version.py"]
line-length = 100
Expand Down

0 comments on commit 70b0602

Please sign in to comment.