Refactor Wait() to not require a timeout

We added a timeout for convenience, but most invocations don't
care about it. Refactor it into WaitWithTimeout() and add a
Wait() that doesn't require a timeout and uses the default.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #1527
Approved by: mheon
This commit is contained in:
Matthew Heon
2018-09-21 09:40:30 -04:00
committed by Atomic Bot
parent 785e9ea1fd
commit 9e81f9daa4
6 changed files with 19 additions and 11 deletions

View File

@ -36,8 +36,6 @@ 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
@ -47,6 +45,10 @@ const CgroupfsDefaultCgroupParent = "/libpod_parent"
// manager in libpod
const SystemdDefaultCgroupParent = "machine.slice"
// DefaultWaitInterval is the default interval between container status checks
// while waiting.
const DefaultWaitInterval = 250 * time.Millisecond
// LinuxNS represents a Linux namespace
type LinuxNS int