From 4fad49fef88c90c9c9eff5e2cc90f6d2deba4fff Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Thu, 14 Dec 2017 23:43:28 +0100 Subject: [PATCH] fix build break --- transport/internet/kcp/connection.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/transport/internet/kcp/connection.go b/transport/internet/kcp/connection.go index 7c118a774..871e7aa8e 100644 --- a/transport/internet/kcp/connection.go +++ b/transport/internet/kcp/connection.go @@ -149,11 +149,12 @@ func (u *Updater) Run() { if u.shouldTerminate() { return } - interval := u.Interval() + ticker := time.NewTicker(u.Interval()) for u.shouldContinue() { u.updateFunc() - time.Sleep(interval) + <-ticker.C } + ticker.Stop() } }