diff options
author | Matthew Heon <matthew.heon@gmail.com> | 2018-09-21 09:40:30 -0400 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-09-21 20:07:51 +0000 |
commit | 9e81f9daa4af9802088530a35a72814172430a36 (patch) | |
tree | e8ae1239d00c83f22a741662852e4dcad34fb2c4 /cmd/podman/wait.go | |
parent | 785e9ea1fd985713db1aa8cc6bec07805faef7a2 (diff) | |
download | podman-9e81f9daa4af9802088530a35a72814172430a36.tar.gz podman-9e81f9daa4af9802088530a35a72814172430a36.tar.bz2 podman-9e81f9daa4af9802088530a35a72814172430a36.zip |
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
Diffstat (limited to 'cmd/podman/wait.go')
-rw-r--r-- | cmd/podman/wait.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/cmd/podman/wait.go b/cmd/podman/wait.go index 48d3885e7..07db20eee 100644 --- a/cmd/podman/wait.go +++ b/cmd/podman/wait.go @@ -6,7 +6,6 @@ import ( "time" "github.com/containers/libpod/cmd/podman/libpodruntime" - "github.com/containers/libpod/libpod" "github.com/pkg/errors" "github.com/urfave/cli" ) @@ -21,7 +20,7 @@ var ( cli.UintFlag{ Name: "interval, i", Usage: "Milliseconds to wait before polling for completion", - Value: uint(libpod.WaitTimeout), + Value: 250, }, LatestFlag, } @@ -69,7 +68,7 @@ func waitCmd(c *cli.Context) error { if c.Uint("interval") == 0 { return errors.Errorf("interval must be greater then 0") } - returnCode, err := ctr.Wait(time.Duration(c.Uint("interval"))) + returnCode, err := ctr.WaitWithInterval(time.Duration(c.Uint("interval")) * time.Millisecond) if err != nil { if lastError != nil { fmt.Fprintln(os.Stderr, lastError) |