mirror of
https://github.com/netbirdio/netbird.git
synced 2026-07-19 15:01:29 +02:00
Refactor UI --------- Co-authored-by: Eduard Gert <kontakt@eduardgert.de> Co-authored-by: braginini <bangvalo@gmail.com> Co-authored-by: Pascal Fischer <32096965+pascal-fischer@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: riccardom <riccardomanfrin@gmail.com>
20 lines
524 B
Go
20 lines
524 B
Go
package internal
|
|
|
|
import (
|
|
"errors"
|
|
)
|
|
|
|
// SetLazyConnEnabled applies a local lazy connection override to the running
|
|
// engine. It pins the setting like an env/CLI flag, so a later management sync
|
|
// cannot override it. syncMsgMux guards ConnMgr, which is not thread-safe.
|
|
func (e *Engine) SetLazyConnEnabled(enabled bool) error {
|
|
e.syncMsgMux.Lock()
|
|
defer e.syncMsgMux.Unlock()
|
|
|
|
if e.connMgr == nil {
|
|
return errors.New("connection manager is not initialised")
|
|
}
|
|
|
|
return e.connMgr.SetLocalLazyConn(e.ctx, enabled)
|
|
}
|