get_readable_message: Acquire lock before accessing the download_dict
Signed-off-by: lzzy12 <jhashivam2020@gmail.com>
This commit is contained in:
parent
918b8653c9
commit
fda8785c64
|
|
@ -35,7 +35,7 @@ For Debian based distros
|
||||||
```
|
```
|
||||||
sudo apt install aria2c
|
sudo apt install aria2c
|
||||||
```
|
```
|
||||||
For Arch and it's derivatives:
|
- For Arch and it's derivatives:
|
||||||
```
|
```
|
||||||
sudo pacman -S aria2
|
sudo pacman -S aria2
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,10 @@ def get_download_str():
|
||||||
return result
|
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 = ''
|
msg = ''
|
||||||
for status in progress_list:
|
for status in progress_list:
|
||||||
msg += f'<b>Name:</b> {status.name()}\n' \
|
msg += f'<b>Name:</b> {status.name()}\n' \
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue