mirror of
https://github.com/containers/podman.git
synced 2025-08-06 19:44:14 +08:00
Merge pull request #16284 from vrothberg/fix-16076
notifyproxy: fix container watcher
This commit is contained in:
@ -183,10 +183,11 @@ func (p *NotifyProxy) WaitAndClose() error {
|
|||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
defer cancel()
|
defer cancel()
|
||||||
go func() {
|
go func() {
|
||||||
|
for {
|
||||||
select {
|
select {
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
return
|
return
|
||||||
default:
|
case <-time.After(time.Second):
|
||||||
state, err := p.container.State()
|
state, err := p.container.State()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
p.errorChan <- err
|
p.errorChan <- err
|
||||||
@ -196,7 +197,7 @@ func (p *NotifyProxy) WaitAndClose() error {
|
|||||||
p.errorChan <- fmt.Errorf("%w: %s", ErrNoReadyMessage, p.container.ID())
|
p.errorChan <- fmt.Errorf("%w: %s", ErrNoReadyMessage, p.container.ID())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
time.Sleep(time.Second)
|
}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user