File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import (
13
13
"strconv"
14
14
"strings"
15
15
"syscall"
16
+ "time"
16
17
17
18
docker "github.com/fsouza/go-dockerclient"
18
19
)
@@ -127,20 +128,25 @@ func getEvents() chan *Event {
127
128
c , err := newConn ()
128
129
if err != nil {
129
130
log .Printf ("cannot connect to docker: %s\n " , err )
130
- return
131
+ time .Sleep (10 * time .Second )
132
+ goto restart
131
133
}
132
134
defer c .Close ()
133
135
134
136
req , err := http .NewRequest ("GET" , "/events" , nil )
135
137
if err != nil {
136
138
log .Printf ("bad request for events: %s\n " , err )
137
- return
139
+ c .Close ()
140
+ time .Sleep (10 * time .Second )
141
+ goto restart
138
142
}
139
143
140
144
resp , err := c .Do (req )
141
145
if err != nil {
142
146
log .Printf ("cannot connect to events endpoint: %s\n " , err )
143
- return
147
+ c .Close ()
148
+ time .Sleep (10 * time .Second )
149
+ goto restart
144
150
}
145
151
defer resp .Body .Close ()
146
152
You can’t perform that action at this time.
0 commit comments