[client] Apply lazy connection toggle to running engine

The daemon SetConfig only persisted the lazy connection flag to the
profile config; the running engine was untouched, so a UI/CLI change
took effect only after a down/up or daemon restart.

Wire SetConfig to push the change into the running engine via a new
ConnMgr.SetLocalLazyConn, which sets enabledLocally like an env/CLI
flag so a later management sync cannot override it, and starts or
stops the lazy manager in place.
This commit is contained in:
Zoltán Papp
2026-06-17 16:51:01 +02:00
parent e264eca8e7
commit 6881c0f985
3 changed files with 60 additions and 0 deletions
+10
View File
@@ -422,6 +422,16 @@ func (s *Server) SetConfig(callerCtx context.Context, msg *proto.SetConfigReques
return nil, fmt.Errorf("failed to update profile config: %w", err)
}
// Apply the lazy connection toggle to the running engine so it takes
// effect without a down/up. s.mutex is already held.
if msg.LazyConnectionEnabled != nil && s.connectClient != nil {
if engine := s.connectClient.Engine(); engine != nil {
if err := engine.SetLazyConnEnabled(msg.GetLazyConnectionEnabled()); err != nil {
log.Errorf("failed to apply lazy connection change at runtime: %v", err)
}
}
}
return &proto.SetConfigResponse{}, nil
}