Compare commits

...

2 Commits

Author SHA1 Message Date
0b606f02fa Bump version 2021-01-17 10:33:10 +01:00
fb78a6e98e Retry ILIAS downloads a few times and only fail that file 2021-01-06 13:08:10 +01:00
3 changed files with 20 additions and 7 deletions

View File

@ -122,9 +122,22 @@ class IliasDownloader:
tmp_file = self._tmp_dir.new_path() tmp_file = self._tmp_dir.new_path()
while not self._try_download(info, tmp_file): download_successful = False
LOGGER.info("Retrying download: %r", info) for _ in range(0, 3):
try:
if not self._try_download(info, tmp_file):
LOGGER.info("Re-Authenticating due to download failure: %r", info)
self._authenticator.authenticate(self._session) self._authenticator.authenticate(self._session)
else:
download_successful = True
break
except IOError as e:
PRETTY.warning(f"I/O Error when downloading ({e}). Retrying...",)
LOGGER.info("Retrying download for %s", info.path)
if not download_successful:
PRETTY.error(f"Download of file {info.path} failed too often! Skipping it...")
return
dst_path = self._organizer.accept_file(tmp_file, info.path) dst_path = self._organizer.accept_file(tmp_file, info.path)
if dst_path and info.modification_date: if dst_path and info.modification_date:

View File

@ -37,7 +37,7 @@ Ensure that you have at least Python 3.8 installed.
To install PFERD or update your installation to the latest version, run this To install PFERD or update your installation to the latest version, run this
wherever you want to install or have already installed PFERD: wherever you want to install or have already installed PFERD:
``` ```
$ pip install git+https://github.com/Garmelon/PFERD@v2.5.2 $ pip install git+https://github.com/Garmelon/PFERD@v2.5.3
``` ```
The use of [venv] is recommended. The use of [venv] is recommended.
@ -60,8 +60,8 @@ $ mkdir Vorlesungen
$ cd Vorlesungen $ cd Vorlesungen
$ python3 -m venv .venv $ python3 -m venv .venv
$ .venv/bin/activate $ .venv/bin/activate
$ pip install git+https://github.com/Garmelon/PFERD@v2.5.2 $ pip install git+https://github.com/Garmelon/PFERD@v2.5.3
$ curl -O https://raw.githubusercontent.com/Garmelon/PFERD/v2.5.2/example_config.py $ curl -O https://raw.githubusercontent.com/Garmelon/PFERD/v2.5.3/example_config.py
$ python3 example_config.py $ python3 example_config.py
$ deactivate $ deactivate
``` ```

View File

@ -2,7 +2,7 @@ from setuptools import find_packages, setup
setup( setup(
name="PFERD", name="PFERD",
version="2.5.2", version="2.5.3",
packages=find_packages(), packages=find_packages(),
install_requires=[ install_requires=[
"requests>=2.21.0", "requests>=2.21.0",