[core/README] Add max_workers config option

Addresses #148
This commit is contained in:
derrod 2020-12-07 23:52:43 +01:00
parent 3aeb48efdf
commit 5db6d9c73f
2 changed files with 5 additions and 0 deletions

View file

@ -469,6 +469,8 @@ Legendary supports some options as well as game specific configuration in `~/.co
log_level = debug
; maximum shared memory (in MiB) to use for installation
max_memory = 1024
; maximum number of worker processes when downloading (fewer wokers will be slower, but also use fewer system resources)
max_workers = 8
; default install directory
install_dir = /mnt/tank/games
; locale override, must be in RFC 1766 format (e.g. "en-US")

View file

@ -792,6 +792,9 @@ class LegendaryCore:
else:
process_opt = False
if not max_workers:
max_workers = self.lgd.config.getint('Legendary', 'max_workers', fallback=0)
dlm = DLManager(install_path, base_url, resume_file=resume_file, status_q=status_q,
max_shared_memory=max_shm * 1024 * 1024, max_workers=max_workers,
dl_timeout=dl_timeout)