File tree 1 file changed +13
-12
lines changed
1 file changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -183,20 +183,21 @@ func (p *NotifyProxy) WaitAndClose() error {
183
183
ctx , cancel := context .WithCancel (context .Background ())
184
184
defer cancel ()
185
185
go func () {
186
- select {
187
- case <- ctx .Done ():
188
- return
189
- default :
190
- state , err := p .container .State ()
191
- if err != nil {
192
- p .errorChan <- err
193
- return
194
- }
195
- if state != define .ContainerStateRunning {
196
- p .errorChan <- fmt .Errorf ("%w: %s" , ErrNoReadyMessage , p .container .ID ())
186
+ for {
187
+ select {
188
+ case <- ctx .Done ():
197
189
return
190
+ case <- time .After (time .Second ):
191
+ state , err := p .container .State ()
192
+ if err != nil {
193
+ p .errorChan <- err
194
+ return
195
+ }
196
+ if state != define .ContainerStateRunning {
197
+ p .errorChan <- fmt .Errorf ("%w: %s" , ErrNoReadyMessage , p .container .ID ())
198
+ return
199
+ }
198
200
}
199
- time .Sleep (time .Second )
200
201
}
201
202
}()
202
203
}
You can’t perform that action at this time.
0 commit comments