Skip to content

Commit

Permalink
Fix deadlock
Browse files Browse the repository at this point in the history
  • Loading branch information
JaskaranSM committed May 12, 2020
1 parent a196ce5 commit 1670b61
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bot/helper/mirror_utils/download_utils/aria2_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def __onDownloadComplete(self, api: API, gid):
download_dict[self.__listener.uid] = AriaDownloadStatus(self, self.__listener)
if download.is_torrent:
download_dict[self.__listener.uid].is_torrent = True
update_all_messages()
update_all_messages()
LOGGER.info(f'Changed gid from {gid} to {self.gid}')
else:
self.__listener.onDownloadComplete()
Expand Down Expand Up @@ -70,7 +70,7 @@ def add_download(self, link: str, path):
with self._resource_lock:
self.gid = download.gid
with download_dict_lock:
download_dict[self._listener.uid] = AriaDownloadStatus(self.gid, self._listener)
download_dict[self.__listener.uid] = AriaDownloadStatus(self, self.__listener)
LOGGER.info(f"Started: {self.gid} DIR:{download.dir} ")

def cancel_download(self):
Expand Down

0 comments on commit 1670b61

Please sign in to comment.