Fix retries for creating MQTT clients
We have some sections where we proceed even if the MQTT connection fails. I think the argument could be made that we shouldn't even pass the initialization (before the demo.queue.launch
without ensuring the connection succeeds.
This is related to https://huggingface.co/spaces/AccelerationConsortium/bambu-a1-mini/discussions/8 where the Bambu MQTT client fails to connect. Although right now we are retrying, we are letting it publish and subscribe despite an unsuccessful connection.
In this draft I've modified get_data
so that we retry the connection a finite number of times and serve stale data if it still fails. Interested in hearing your thoughts.
Agreed, some issues with this repo: a bunch of silent failures or other places that should throw real errors and not continue. Pretend data that makes it seem like it's working when it's not actually (even set by default in some cases). If you have time, would be great if you could do an overhaul.