Skip to content

Commit

Permalink
Reuse IsTransientError
Browse files Browse the repository at this point in the history
Signed-off-by: Seokju Hong <seokju@vessl.ai>
  • Loading branch information
Suckzoo committed Sep 26, 2022
1 parent 988fa41 commit 40f28e4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
7 changes: 0 additions & 7 deletions util/errors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,6 @@ func IsTransientErr(err error) bool {
return isTransient
}

func IsTransientNetworkErr(err error) bool {
if err == nil {
return false
}
return isTransientNetworkErr(err)
}

func matchTransientErrPattern(err error) bool {
// TRANSIENT_ERROR_PATTERN allows to specify the pattern to match for errors that can be seen as transient
// and retryable.
Expand Down
2 changes: 1 addition & 1 deletion workflow/util/plugins/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (p *Client) Call(ctx context.Context, method string, args interface{}, repl
return true
}
}
return strings.Contains(err.Error(), "connection refused") || errors.IsTransientNetworkErr(err)
return strings.Contains(err.Error(), "connection refused") || errors.IsTransientErr(err)
}, func() error {
log.Debug("Calling plugin")
req, err := http.NewRequestWithContext(ctx, "POST", fmt.Sprintf("%s/api/v1/%s", p.address, method), bytes.NewBuffer(body))
Expand Down

0 comments on commit 40f28e4

Please sign in to comment.