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

Method initStatsTickers

backend/wireguard/jobs.go:14–22  ·  view source on GitHub ↗

initStatsTickers initializes stats update tickers

(ctx context.Context)

Source from the content-addressed store, hash-verified

12
13// initStatsTickers initializes stats update tickers
14func (wg *WireGuard) initStatsTickers(ctx context.Context) {
15 wg.updateInterval = time.Duration(wg.cfg.StatsUpdateIntervalSeconds) * time.Second
16 cleanupInterval := time.Duration(wg.cfg.StatsCleanupIntervalSeconds) * time.Second
17
18 wg.updateTicker = time.NewTicker(wg.updateInterval)
19 wg.cleanupTicker = time.NewTicker(cleanupInterval)
20
21 go wg.runStatsUpdateLoop(ctx)
22}
23
24// runStatsUpdateLoop runs the stats update loop
25func (wg *WireGuard) runStatsUpdateLoop(ctx context.Context) {

Callers 1

newWithManagerFactoryFunction · 0.95

Calls 1

runStatsUpdateLoopMethod · 0.95

Tested by

no test coverage detected