File tree 3 files changed +21
-5
lines changed
3 files changed +21
-5
lines changed Original file line number Diff line number Diff line change 1
- FROM docker/compose
1
+ FROM docker/compose:1.25.1
2
2
COPY pico /
3
3
ENTRYPOINT ["/pico" ]
Original file line number Diff line number Diff line change @@ -113,15 +113,25 @@ func (p *GitProvider) watchConfig() (err error) {
113
113
return errors .Wrap (err , "failed to watch config target" )
114
114
}
115
115
116
+ errs := make (chan error )
116
117
go func () {
117
118
e := p .configWatcher .Run ()
118
119
if e != nil && ! errors .Is (e , context .Canceled ) {
119
- zap .L ().Error ("config watcher failed" , zap .Error (e ))
120
+ errs <- e
121
+ }
122
+ // TODO: forward these errors elsewhere.
123
+ for e = range p .configWatcher .Errors {
124
+ zap .L ().Error ("config watcher error occurred" , zap .Error (e ))
120
125
}
121
126
}()
122
127
zap .L ().Debug ("created new config watcher, awaiting setup" )
123
128
124
- <- p .configWatcher .InitialDone
129
+ select {
130
+ case <- p .configWatcher .InitialDone :
131
+ case err = <- errs :
132
+ }
133
+
134
+ zap .L ().Debug ("config watcher initialised" )
125
135
126
136
return
127
137
}
Original file line number Diff line number Diff line change @@ -192,15 +192,21 @@ func (w *GitWatcher) watchTargets() (err error) {
192
192
return errors .Wrap (err , "failed to watch targets" )
193
193
}
194
194
195
+ errs := make (chan error )
195
196
go func () {
196
197
e := w .targetsWatcher .Run ()
197
198
if e != nil && ! errors .Is (e , context .Canceled ) {
198
- w . errors <- e
199
+ errs <- e
199
200
}
201
+ // forward errors from the watcher to the central for-select above
202
+ w .errors <- <- w .targetsWatcher .Errors
200
203
}()
201
204
zap .L ().Debug ("created targets watcher, awaiting setup" )
202
205
203
- <- w .targetsWatcher .InitialDone
206
+ select {
207
+ case <- w .targetsWatcher .InitialDone :
208
+ case err = <- errs :
209
+ }
204
210
205
211
zap .L ().Debug ("targets watcher initialised" )
206
212
You can’t perform that action at this time.
0 commit comments