Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
add a second lock
Browse files Browse the repository at this point in the history
  • Loading branch information
Jules-WinnfieldX committed Dec 9, 2023
1 parent c0ce217 commit f8a8664
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cyberdrop_dl/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "5.0.93"
__version__ = "5.0.94"
6 changes: 6 additions & 0 deletions cyberdrop_dl/downloader/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ def __init__(self, manager: Manager, domain: str):

self._unfinished_count = 0
self._current_attempt_filesize = {}

self._lock = False
self._lock2 = False

self.processed_items: list = []

Expand Down Expand Up @@ -328,9 +330,13 @@ async def download(self, media_item: MediaItem) -> None:
FL_Filename = media_item.filename

try:
if self._lock2:
await asyncio.sleep(gauss(0.1, 0.3))
self._lock2 = True
while await self._file_lock.check_lock(FL_Filename):
await asyncio.sleep(gauss(1, 1.5))
await self._file_lock.add_lock(FL_Filename)
self._lock2 = False

if not isinstance(media_item.current_attempt, int):
media_item.current_attempt = 1
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "cyberdrop-dl"
version = "5.0.93"
version = "5.0.94"
description = "Bulk downloader for multiple file hosts"
authors = ["Jules Winnfield <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit f8a8664

Please sign in to comment.