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

Method logStatsDeviceReadError

backend/wireguard/jobs.go:103–116  ·  view source on GitHub ↗
(err error)

Source from the content-addressed store, hash-verified

101}
102
103func (wg *WireGuard) logStatsDeviceReadError(err error) {
104 now := time.Now()
105
106 wg.mu.Lock()
107 if !wg.lastStatsErrAt.IsZero() && now.Sub(wg.lastStatsErrAt) < statsDeviceErrorLogInterval {
108 wg.mu.Unlock()
109 return
110 }
111 wg.lastStatsErrAt = now
112 wg.mu.Unlock()
113
114 log.Printf("wireguard stats update skipped: failed to read device: %v", err)
115 wg.emitWarningLogf("wireguard stats update skipped: failed to read device: %v", err)
116}
117
118// cleanupOfflineUsers removes deleted stats entries once their traffic has been reported.
119func (wg *WireGuard) cleanupOfflineUsers(ctx context.Context) {

Callers 1

updateConnectedPeersMethod · 0.95

Calls 1

emitWarningLogfMethod · 0.95

Tested by

no test coverage detected