From 043a28eb339d8c3e259e53a8ac40dc56fe7389fb Mon Sep 17 00:00:00 2001 From: Cuong Manh Le Date: Thu, 13 Feb 2025 17:12:36 +0700 Subject: [PATCH] internal/clientinfo: allow router discovers initialization to be failed Currently, the router discovers initialization are done during startup. If it were failed, the discovers are skipped. This is too strict, since the initialization could be failed due to some requires services are not ready when ctrld started, or router specific requirements for services management during startup (like UnifiOS v4.0.20). To fix this, ctrld should relax the initialization checking, allow it to be failed, and still use the discovers later. --- internal/clientinfo/client_info.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/internal/clientinfo/client_info.go b/internal/clientinfo/client_info.go index 35d5dbb..582f661 100644 --- a/internal/clientinfo/client_info.go +++ b/internal/clientinfo/client_info.go @@ -207,11 +207,10 @@ func (t *Table) init() { } for platform, discover := range discovers { if err := discover.refresh(); err != nil { - ctrld.ProxyLogger.Load().Error().Err(err).Msgf("could not init %s discover", platform) - } else { - t.hostnameResolvers = append(t.hostnameResolvers, discover) - t.refreshers = append(t.refreshers, discover) + ctrld.ProxyLogger.Load().Warn().Err(err).Msgf("failed to init %s discover", platform) } + t.hostnameResolvers = append(t.hostnameResolvers, discover) + t.refreshers = append(t.refreshers, discover) } } // Hosts file mapping.