mirror of
https://github.com/containers/podman.git
synced 2025-10-18 03:33:32 +08:00
Add --interval flag to podman wait
Waiting uses a lot of CPU, so drop back to checking once/second and allow user to pass in the interval. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
@ -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 {
|
||||
|
Reference in New Issue
Block a user