Invoke callback on handshake success in WireGuard watcher

This commit is contained in:
Zoltán Papp
2026-01-29 11:43:31 +01:00
parent e7283a8198
commit 138e728427

View File

@@ -95,6 +95,9 @@ func (w *WGWatcher) periodicHandshakeCheck(ctx context.Context, onDisconnectedFn
if lastHandshake.IsZero() {
elapsed := calcElapsed(enabledTime, *handshake)
w.log.Infof("first wg handshake detected within: %.2fsec, (%s)", elapsed, handshake)
if onHandshakeSuccessFn != nil {
onHandshakeSuccessFn(*handshake)
}
}
lastHandshake = *handshake