From 7166829704cbaf4684b5c96e4d7311179dafecda Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Wed, 25 Feb 2026 12:53:17 +0100 Subject: [PATCH] Wait for providers to load at startup --- music_assistant/mass.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/music_assistant/mass.py b/music_assistant/mass.py index 44e59de4..e2ec01a1 100644 --- a/music_assistant/mass.py +++ b/music_assistant/mass.py @@ -896,10 +896,11 @@ class MusicAssistant: ) ] # load providers concurrently via tasks - for prov_conf in other_configs: - # Use a task so we can load multiple providers at once. - # If a provider fails, that will not block the loading of other providers. - self.create_task(self.load_provider(prov_conf.instance_id, allow_retry=True)) + async with TaskManager(self, 2) as tg: + for prov_conf in other_configs: + # Use a task so we can load multiple providers at once. + # If a provider fails, that will not block the loading of other providers. + tg.create_task(self.load_provider(prov_conf.instance_id, allow_retry=True)) async def _load_provider(self, conf: ProviderConfig) -> None: """Load (or reload) a provider.""" -- 2.34.1