diff --git a/custom_components/hacs/const.py b/custom_components/hacs/const.py index 3e8a4069b53..fc950dd0958 100644 --- a/custom_components/hacs/const.py +++ b/custom_components/hacs/const.py @@ -13,7 +13,7 @@ PACKAGE_NAME = "custom_components.hacs" DEFAULT_CONCURRENT_TASKS = 15 -DEFAULT_CONCURRENT_BACKOFF_TIME = 0 +DEFAULT_CONCURRENT_BACKOFF_TIME = 1 PLATFORMS = ["sensor"] diff --git a/custom_components/hacs/utils/queue_manager.py b/custom_components/hacs/utils/queue_manager.py index c8b6e951b4e..a3784e30e9e 100644 --- a/custom_components/hacs/utils/queue_manager.py +++ b/custom_components/hacs/utils/queue_manager.py @@ -16,11 +16,10 @@ class QueueManager: """The QueueManager class.""" - running = False - queue: list[Coroutine] = [] - def __init__(self, hass: HomeAssistant) -> None: self.hass = hass + self.queue: list[Coroutine] = [] + self.running = False @property def pending_tasks(self) -> int: @@ -38,7 +37,7 @@ def clear(self) -> None: def add(self, task: Coroutine) -> None: """Add a task to the queue.""" - self.queue.append(self.hass.loop.create_task(task)) + self.queue.append(task) async def execute(self, number_of_tasks: int | None = None) -> None: """Execute the tasks in the queue."""