Commit a87dd175 by Emil Tullstedt Committed by GitHub

UsageStats: Purpose named variables (#31264)

parent 8f20b13f
......@@ -54,18 +54,18 @@ func (uss *UsageStatsService) Init() error {
func (uss *UsageStatsService) Run(ctx context.Context) error {
uss.updateTotalStats()
onceEveryDayTick := time.NewTicker(time.Hour * 24)
everyMinuteTicker := time.NewTicker(time.Minute * 30)
defer onceEveryDayTick.Stop()
defer everyMinuteTicker.Stop()
sendReportTicker := time.NewTicker(time.Hour * 24)
updateStatsTicker := time.NewTicker(time.Minute * 30)
defer sendReportTicker.Stop()
defer updateStatsTicker.Stop()
for {
select {
case <-onceEveryDayTick.C:
case <-sendReportTicker.C:
if err := uss.sendUsageStats(ctx); err != nil {
metricsLogger.Warn("Failed to send usage stats", "err", err)
}
case <-everyMinuteTicker.C:
case <-updateStatsTicker.C:
uss.updateTotalStats()
case <-ctx.Done():
return ctx.Err()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment