From fda8785c64168d0fa1781d1e1b47af3a12f2d93a Mon Sep 17 00:00:00 2001 From: lzzy12 Date: Fri, 11 Oct 2019 23:25:13 +0530 Subject: [PATCH] get_readable_message: Acquire lock before accessing the download_dict Signed-off-by: lzzy12 --- README.md | 2 +- bot/helper/ext_utils/bot_utils.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2fd80a7..3fccba1 100644 --- a/README.md +++ b/README.md @@ -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 ``` diff --git a/bot/helper/ext_utils/bot_utils.py b/bot/helper/ext_utils/bot_utils.py index db0c354..55a302f 100644 --- a/bot/helper/ext_utils/bot_utils.py +++ b/bot/helper/ext_utils/bot_utils.py @@ -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'Name: {status.name()}\n' \