Execute PopulateNetbirdConfig in a go routine

This commit is contained in:
Diego Romar
2025-12-18 13:58:31 -03:00
parent 72e1fe7b48
commit 0e9cddf2e8

View File

@@ -463,9 +463,15 @@ func (e *Engine) Start(netbirdConfig *mgmProto.NetbirdConfig, mgmtURL *url.URL)
log.Info("created dns server")
// Populate DNS cache with NetbirdConfig and management URL for early resolution
if err := e.PopulateNetbirdConfig(netbirdConfig, mgmtURL); err != nil {
log.Warnf("failed to populate DNS cache: %v", err)
}
go func() {
if err := e.PopulateNetbirdConfig(netbirdConfig, mgmtURL); err != nil {
log.Warnf("failed to populate DNS cache: %v", err)
} else {
log.Info("populated DNS cache successfully")
}
}()
log.Info("populated DNS cache with NetbirdConfig and management URL")
e.routeManager = routemanager.NewManager(routemanager.ManagerConfig{
Context: e.ctx,