fixup! refactor(container): restart handling
This commit is contained in:
parent
c999e418f5
commit
d65fca0afe
@ -403,7 +403,6 @@ func (a *Client) runContainerLoop(
|
||||
restartCount: restartCount,
|
||||
}
|
||||
case <-timer.C:
|
||||
fmt.Println("ContainerWait timer expired")
|
||||
a.logger.Info("Container restarting", "id", shortID(containerID), "restart_count", restartCount)
|
||||
restartCount++
|
||||
if err := a.apiClient.ContainerStart(ctx, containerID, container.StartOptions{}); err != nil {
|
||||
@ -412,11 +411,9 @@ func (a *Client) runContainerLoop(
|
||||
}
|
||||
a.logger.Info("Restarted container", "id", shortID(containerID))
|
||||
case err := <-errC:
|
||||
fmt.Println("ContainerWait error", err)
|
||||
containerErrC <- err
|
||||
return
|
||||
case <-ctx.Done():
|
||||
fmt.Println("ContainerWait cancelled")
|
||||
// This is probably because the container was stopped.
|
||||
containerRespC <- containerWaitResponse{WaitResponse: container.WaitResponse{}, restarting: false}
|
||||
return
|
||||
|
Loading…
x
Reference in New Issue
Block a user