get_readable_message: Acquire lock before accessing the download_dict

Signed-off-by: lzzy12 <jhashivam2020@gmail.com>
This commit is contained in:
lzzy12 2019-10-11 23:25:13 +05:30
parent 918b8653c9
commit fda8785c64
2 changed files with 5 additions and 2 deletions

View File

@ -35,7 +35,7 @@ For Debian based distros
```
sudo apt install aria2c
```
For Arch and it's derivatives:
- For Arch and it's derivatives:
```
sudo pacman -S aria2
```

View File

@ -77,7 +77,10 @@ def get_download_str():
return result
def get_readable_message(progress_list: list = download_dict.values()):
def get_readable_message(progress_list: list = None):
if progress_list is None:
with download_dict_lock:
progress_list = list(download_dict.values())
msg = ''
for status in progress_list:
msg += f'<b>Name:</b> {status.name()}\n' \