MCPcopy Create free account
hub / github.com/PasarGuard/node / UpdateUsersAndRestart

Method UpdateUsersAndRestart

backend/wireguard/user.go:41–50  ·  view source on GitHub ↗

UpdateUsersAndRestart applies targeted user updates, then rebuilds the full peer snapshot so interface-wide settings like keepalive are reapplied to all peers.

(_ context.Context, users []*common.User)

Source from the content-addressed store, hash-verified

39// UpdateUsersAndRestart applies targeted user updates, then rebuilds the full
40// peer snapshot so interface-wide settings like keepalive are reapplied to all peers.
41func (wg *WireGuard) UpdateUsersAndRestart(_ context.Context, users []*common.User) error {
42 wg.syncMu.Lock()
43 defer wg.syncMu.Unlock()
44
45 if err := wg.syncUsersPartialReconcile(users); err != nil {
46 return err
47 }
48
49 return wg.restartLocked()
50}

Calls 2

restartLockedMethod · 0.95