This commit is contained in:
jdl
2026-06-15 18:02:44 +02:00
parent 802ca9aba4
commit eaa101f976
3 changed files with 5 additions and 7 deletions

View File

@@ -98,11 +98,11 @@ func (a *App) Run() error {
case e := <-a.multicastCh: case e := <-a.multicastCh:
a.onMulticastDiscovery(e) a.onMulticastDiscovery(e)
case <-stateTicker.C: case <-stateTicker.C:
a.onTick() a.onStateTick()
case <-pingTicker.C: case <-pingTicker.C:
a.onPingTicker() a.onPingTick()
tickCount++ tickCount++
if tickCount == 0 { if tickCount%8 == 0 {
a.logNetworkState() a.logNetworkState()
} }

View File

@@ -5,7 +5,7 @@ import (
"vppn/peer/control" "vppn/peer/control"
) )
func (a *App) onPingTicker() { func (a *App) onPingTick() {
now := time.Now().UnixNano() now := time.Now().UnixNano()
for _, p := range a.peersByIP { for _, p := range a.peersByIP {
if p.Role == control.Client { if p.Role == control.Client {

View File

@@ -8,11 +8,9 @@ import (
"vppn/peer/wginterface" "vppn/peer/wginterface"
) )
func (a *App) onTick() { func (a *App) onStateTick() {
wgPeers := a.devPeers() wgPeers := a.devPeers()
now := time.Now().UnixNano()
for _, wgPeer := range wgPeers { for _, wgPeer := range wgPeers {
p, ok := a.peersByKey[wgPeer.PublicKey] p, ok := a.peersByKey[wgPeer.PublicKey]
if !ok { if !ok {