initStatsTickers initializes stats update tickers
(ctx context.Context)
| 12 | |
| 13 | // initStatsTickers initializes stats update tickers |
| 14 | func (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 |
| 25 | func (wg *WireGuard) runStatsUpdateLoop(ctx context.Context) { |
no test coverage detected