From c116139f8997d3bece92ed3d30b12f477f021f80 Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Sat, 8 Sep 2018 20:12:55 +0200 Subject: [PATCH] Add ticker for real --- cmd/eksterd/events.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/eksterd/events.go b/cmd/eksterd/events.go index 915dbd0..b67c76b 100644 --- a/cmd/eksterd/events.go +++ b/cmd/eksterd/events.go @@ -23,9 +23,10 @@ func newConsumer(conn net.Conn) *Consumer { fmt.Fprint(conn, "\r\n") go func() { + ticker := time.Tick(10 * time.Second) for { select { - case <-time.Tick(10 * time.Second): + case <-ticker: fmt.Fprint(conn, `event: ping`) fmt.Fprint(conn, "\r\n") fmt.Fprint(conn, "\r\n")