Skip to content

Commit

Permalink
Add retry around QueryOp in service usage operation utils (#3752)
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician authored and emilymye committed Jun 1, 2019
1 parent db33484 commit df63be6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion google/serviceusage_operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ func (w *ServiceUsageOperationWaiter) QueryOp() (interface{}, error) {
if w == nil {
return nil, fmt.Errorf("Cannot query operation, it's unset or nil.")
}
return w.Service.Operations.Get(w.Op.Name).Do()

var op *serviceusage.Operation
err := retryTimeDuration(func() (opErr error) {
op, opErr = w.Service.Operations.Get(w.Op.Name).Do()
return opErr
}, DefaultRequestTimeout)
return op, err
}

func serviceUsageOperationWait(config *Config, op *serviceusage.Operation, activity string) error {
Expand Down

0 comments on commit df63be6

Please sign in to comment.