Skip to content

Commit

Permalink
Add download delay to failed items
Browse files Browse the repository at this point in the history
  • Loading branch information
justin025 committed Nov 7, 2024
1 parent b329a3c commit 6a8d627
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/onthespot/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,14 +345,17 @@ def run(self):
continue
except Exception as e:
logger.error(f"Unknown Exception: {str(e)}")
if os.path.exists(temp_file_path):
os.remove(temp_file_path)
if os.path.exists(file_path):
os.remove(file_path)
item['item_status'] = "Failed"
if self.gui:
self.progress.emit(item, self.tr("Failed"), 0)

time.sleep(config.get("download_delay"))
self.readd_item_to_download_queue(item)

if os.path.exists(temp_file_path):
os.remove(temp_file_path)
if os.path.exists(file_path):
os.remove(file_path)
continue
else:
time.sleep(1)
Expand Down

0 comments on commit 6a8d627

Please sign in to comment.