diff options
Diffstat (limited to 'client/go/internal/cli/cmd/waiter.go')
-rw-r--r-- | client/go/internal/cli/cmd/waiter.go | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/client/go/internal/cli/cmd/waiter.go b/client/go/internal/cli/cmd/waiter.go index 34a10ccce33..0cfb3aa76d5 100644 --- a/client/go/internal/cli/cmd/waiter.go +++ b/client/go/internal/cli/cmd/waiter.go @@ -1,3 +1,4 @@ +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package cmd import ( @@ -10,17 +11,12 @@ import ( // Waiter waits for Vespa services to become ready, within a timeout. type Waiter struct { - // Once species whether we should wait at least one time, irregardless of timeout. - Once bool - // Timeout specifies how long we should wait for an operation to complete. Timeout time.Duration // TODO(mpolden): Consider making this a budget cli *CLI } -func (w *Waiter) wait() bool { return w.Once || w.Timeout > 0 } - // DeployService returns the service providing the deploy API on given target, func (w *Waiter) DeployService(target vespa.Target) (*vespa.Service, error) { s, err := target.DeployService() @@ -73,8 +69,6 @@ func (w *Waiter) Services(target vespa.Target) ([]*vespa.Service, error) { func (w *Waiter) maybeWaitFor(service *vespa.Service) error { if w.Timeout > 0 { w.cli.printInfo("Waiting up to ", color.CyanString(w.Timeout.String()), " for ", service.Description(), "...") - } - if w.wait() { return service.Wait(w.Timeout) } return nil |