diff options
author | Matthew Heon <matthew.heon@gmail.com> | 2018-09-14 16:52:13 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-14 16:52:13 -0400 |
commit | 040555534532de45c84b8bcf09a6e6e59144b43b (patch) | |
tree | d68b35ff6f014f30a7beb308e85e111faa25ed40 /libpod | |
parent | 8541ed41e4dde12173e9f488f136f216d099274e (diff) | |
parent | 9ec82caa3147d7afaf9361748661c8868194d132 (diff) | |
download | podman-040555534532de45c84b8bcf09a6e6e59144b43b.tar.gz podman-040555534532de45c84b8bcf09a6e6e59144b43b.tar.bz2 podman-040555534532de45c84b8bcf09a6e6e59144b43b.zip |
Merge pull request #1434 from rhatdan/wait
Add --interval flag to podman wait
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/container.go | 2 | ||||
-rw-r--r-- | libpod/container_api.go | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/libpod/container.go b/libpod/container.go index e748cb84d..f68a3535e 100644 --- a/libpod/container.go +++ b/libpod/container.go @@ -36,6 +36,8 @@ const ( ContainerStateStopped ContainerStatus = iota // ContainerStatePaused indicates that the container has been paused ContainerStatePaused ContainerStatus = iota + // WaitTimeout is the wait timeout before checking for container exit + WaitTimeout = time.Second / time.Millisecond ) // CgroupfsDefaultCgroupParent is the cgroup parent for CGroupFS in libpod diff --git a/libpod/container_api.go b/libpod/container_api.go index 86e2370ea..437699bae 100644 --- a/libpod/container_api.go +++ b/libpod/container_api.go @@ -592,12 +592,11 @@ func (c *Container) Inspect(size bool) (*inspect.ContainerInspectData, error) { } // Wait blocks on a container to exit and returns its exit code -func (c *Container) Wait() (int32, error) { +func (c *Container) Wait(waitTimeout time.Duration) (int32, error) { if !c.valid { return -1, ErrCtrRemoved } - - err := wait.PollImmediateInfinite(100*time.Millisecond, + err := wait.PollImmediateInfinite(waitTimeout*time.Millisecond, func() (bool, error) { stopped, err := c.isStopped() if err != nil { |