add sleep_interval to queue.py (#832)

add sleep_interval to mitigate rate_limiting induced errors when adding videos to queue
This commit is contained in:
Styloy
2025-01-02 23:21:17 -05:00
committed by GitHub
parent be20d56d05
commit 6e3a647d6a

View File

@@ -6,6 +6,7 @@ Functionality:
import json
from datetime import datetime
from time import sleep
from appsettings.src.config import AppConfig
from common.src.es_connect import ElasticWrap, IndexPaginate
@@ -245,7 +246,9 @@ class PendingList(PendingIndex):
total = len(self.missing_videos)
videos_added = []
sleep_interval = self.config["downloads"].get("sleep_interval", 0)
for idx, (youtube_id, vid_type) in enumerate(self.missing_videos):
sleep(sleep_interval)
if self.task and self.task.is_stopped():
break