summaryrefslogtreecommitdiff
path: root/internal/clients/stats.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/clients/stats.go')
-rw-r--r--internal/clients/stats.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/internal/clients/stats.go b/internal/clients/stats.go
index 7a6643b..5880fd1 100644
--- a/internal/clients/stats.go
+++ b/internal/clients/stats.go
@@ -39,6 +39,9 @@ func newTailStats(servers int) *stats {
func (s *stats) Start(ctx context.Context, throttleCh <-chan struct{},
statsCh <-chan string, quiet bool) {
+ ticker := time.NewTicker(3 * time.Second)
+ defer ticker.Stop()
+
var connectedLast int
for {
var force bool
@@ -48,7 +51,7 @@ func (s *stats) Start(ctx context.Context, throttleCh <-chan struct{},
case message := <-statsCh:
messages = append(messages, message)
force = true
- case <-time.After(time.Second * 3):
+ case <-ticker.C:
case <-ctx.Done():
return
}