Ubuntu Pastebin

Paste from william at Fri, 4 Dec 2015 10:54:27 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
diff --git a/api/apiclient.go b/api/apiclient.go
index 6617976..5ab8b0b 100644
--- a/api/apiclient.go
+++ b/api/apiclient.go
@@ -276,9 +276,9 @@ func createWebsocketDialer(cfg *websocket.Config, opts DialOpts) func(<-chan str
 }
 
 func (s *State) heartbeatMonitor() {
+	defer close(s.broken)
 	for {
 		if err := s.Ping(); err != nil {
-			close(s.broken)
 			return
 		}
 		select {
Download as text