From f552fd61b85253ddc2cfa13333142d6f5d853c2d Mon Sep 17 00:00:00 2001 From: Andreas Linde <42185+DerAndereAndi@users.noreply.github.com> Date: Wed, 21 Dec 2022 14:14:25 +0100 Subject: [PATCH] Fix EEBUS setup timing issue (#5527) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The EBBUS server should not be started in a go-routine. If avahi connection takes too long, it can happen that devices are registered and thus searched for, before mDNS setup is complete. This change results in a slower startup, roughly 1s, as checking if avahi is available is now blocking. I’ll check if I can change the setup code to be non blocking and device registrations not to cause issues when the mDNS server is not ready. See https://github.com/enbility/eebus-go/issues/44 --- cmd/setup.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/setup.go b/cmd/setup.go index 795806a21..69deae049 100644 --- a/cmd/setup.go +++ b/cmd/setup.go @@ -198,7 +198,7 @@ func configureEEBus(conf map[string]interface{}) error { return fmt.Errorf("failed configuring eebus: %w", err) } - go server.EEBusInstance.Run() + server.EEBusInstance.Run() shutdown.Register(server.EEBusInstance.Shutdown) return nil