Skip to content

Commit

Permalink
Remove unnecessarry if statements for operationWaiter errors (#8860)
Browse files Browse the repository at this point in the history
  • Loading branch information
gleichda authored Sep 5, 2023
1 parent 7cbfb6f commit 20abbfa
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions mmv1/third_party/terraform/tpgresource/common_operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,7 @@ func CommonRefreshFunc(w Waiter) resource.StateRefreshFunc {

func OperationWait(w Waiter, activity string, timeout time.Duration, pollInterval time.Duration) error {
if OperationDone(w) {
if w.Error() != nil {
return w.Error()
}
return nil
return w.Error()
}

c := &resource.StateChangeConf{
Expand All @@ -161,11 +158,8 @@ func OperationWait(w Waiter, activity string, timeout time.Duration, pollInterva
if err != nil {
return err
}
if w.Error() != nil {
return w.Error()
}

return nil
return w.Error()
}

// The cloud resource manager API operation is an example of one of many
Expand Down

0 comments on commit 20abbfa

Please sign in to comment.