Skip to content

Commit

Permalink
fix: remove upstream which is ref by multi-routes cause retry (#472)
Browse files Browse the repository at this point in the history
  • Loading branch information
gxthrj committed May 20, 2021
1 parent a7e187b commit 456fbd2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/apisix/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,11 @@ func (c *cluster) deleteResource(ctx context.Context, url string) error {

if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusNoContent && resp.StatusCode != http.StatusNotFound {
err = multierr.Append(err, fmt.Errorf("unexpected status code %d", resp.StatusCode))
err = multierr.Append(err, fmt.Errorf("error message: %s", readBody(resp.Body, url)))
message := readBody(resp.Body, url)
err = multierr.Append(err, fmt.Errorf("error message: %s", message))
if strings.Contains(message, "still using") {
return cache.ErrStillInUse
}
return err
}
return nil
Expand Down

0 comments on commit 456fbd2

Please sign in to comment.