-
-
Notifications
You must be signed in to change notification settings - Fork 421
Open
Description
We used cache_time=9999999999999
to effectively disable redownloading of the file which is supposed to never change. The file downloaded on a first time, but on a second time pyinfra crashed with the exception:
--> An internal exception occurred:
File "/home/*********/relay/venv/lib/python3.11/site-packages/pyinfra/operations/files.py", line 129, in download
ctime = host.get_fact(Date).replace(tzinfo=None) - timedelta(seconds=cache_time)
^^^^^^^^^^^^^^^^^
OverflowError: date value out of range
--> The full traceback has been written to pyinfra-debug.log
One way to fix it would be to handle the underflow and assume that the cache has not expired if there is an underflow.
Another option that would have helped us is to not redownload the file if checksum is specified and the file with the correct checksum is already there. This would be preferable for our usecase, then we would not need to specify cache_time
at all.
See chatmail/relay#602 for downstream issue.
Metadata
Metadata
Assignees
Labels
No labels