fix(musicseerr): implement download concurrency limit of 5 using threading.Semaphore
Build and Push Docker Images / build (api) (push) Successful in 2m17s Details
Build and Push Docker Images / build (musicseerr) (push) Successful in 14m3s Details
Build and Push Docker Images / build (web) (push) Successful in 6m51s Details
Build and Push Docker Images / build (nextgen) (push) Successful in 20m59s Details
Build and Push Docker Images / build (worker) (push) Successful in 23m34s Details
Build and Push Docker Images / deploy (push) Successful in 19s Details

This commit is contained in:
fchinembiri 2026-07-10 21:20:43 +02:00
parent f3779f00cd
commit 6c4530c70d
1 changed files with 8 additions and 0 deletions

View File

@ -5,12 +5,15 @@ import logging
import re import re
import requests import requests
import json import json
import threading
from bs4 import BeautifulSoup from bs4 import BeautifulSoup
from urllib.parse import urljoin from urllib.parse import urljoin
from mutagen.mp3 import EasyMP3 from mutagen.mp3 import EasyMP3
from mutagen.id3 import ID3 from mutagen.id3 import ID3
from curl_cffi import requests as cf_requests from curl_cffi import requests as cf_requests
DOWNLOAD_SEMAPHORE = threading.Semaphore(5)
# Configure Logger # Configure Logger
logging.basicConfig(level=logging.INFO) logging.basicConfig(level=logging.INFO)
logger = logging.getLogger("musicseerr-tasks") logger = logging.getLogger("musicseerr-tasks")
@ -483,6 +486,11 @@ def symlink_existing_tracks(temp_dir: str):
def run_download_task(task_id: str, query: str, proxy_url: str, jobs_dict: dict, chat_id: int = None): def run_download_task(task_id: str, query: str, proxy_url: str, jobs_dict: dict, chat_id: int = None):
with DOWNLOAD_SEMAPHORE:
_run_download_task_impl(task_id, query, proxy_url, jobs_dict, chat_id)
def _run_download_task_impl(task_id: str, query: str, proxy_url: str, jobs_dict: dict, chat_id: int = None):
""" """
Core download manager task that runs in the background. Core download manager task that runs in the background.
""" """