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)
| 39 | // UpdateUsersAndRestart applies targeted user updates, then rebuilds the full |
| 40 | // peer snapshot so interface-wide settings like keepalive are reapplied to all peers. |
| 41 | func (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 | } |