Skip to content

Commit

Permalink
fix: Avoid retrying caused by deleting cache 404
Browse files Browse the repository at this point in the history
  • Loading branch information
gxthrj committed May 8, 2021
1 parent 371bcd8 commit 76c8a95
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion pkg/apisix/global_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,9 @@ func (r *globalRuleClient) Delete(ctx context.Context, obj *v1.GlobalRule) error
}
if err := r.cluster.cache.DeleteGlobalRule(obj); err != nil {
log.Errorf("failed to reflect global_rule delete to cache: %s", err)
return err
if err != cache.ErrNotFound {
return err
}
}
return nil
}
Expand Down
4 changes: 3 additions & 1 deletion pkg/apisix/stream_route.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,9 @@ func (r *streamRouteClient) Delete(ctx context.Context, obj *v1.StreamRoute) err
}
if err := r.cluster.cache.DeleteStreamRoute(obj); err != nil {
log.Errorf("failed to reflect stream_route delete to cache: %s", err)
return err
if err != cache.ErrNotFound {
return err
}
}
return nil
}
Expand Down

0 comments on commit 76c8a95

Please sign in to comment.