Ver Fonte

fix build break

Darien Raymond há 7 anos atrás
pai
commit
4fad49fef8
1 ficheiros alterados com 3 adições e 2 exclusões
  1. 3 2
      transport/internet/kcp/connection.go

+ 3 - 2
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()
 	}
 }