Wait for providers to load at startup
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Wed, 25 Feb 2026 11:53:17 +0000 (12:53 +0100)
committerMarcel van der Veldt <m.vanderveldt@outlook.com>
Wed, 25 Feb 2026 11:53:17 +0000 (12:53 +0100)
music_assistant/mass.py

index 44e59de4613028b8e18eacb58bf58bb953d23cdb..e2ec01a17587d09c44709018d4220d8a0f897b81 100644 (file)
@@ -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."""