Skip to content

Commit

Permalink
no need to requeue if resource is not found.
Browse files Browse the repository at this point in the history
Signed-off-by: morvencao <lcao@redhat.com>
  • Loading branch information
morvencao committed Jan 2, 2025
1 parent 29902c2 commit eb7c030
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cmd/maestro/server/grpc_broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,10 @@ func (bkr *GRPCBroker) handleRes(resource *api.Resource) error {
func (bkr *GRPCBroker) OnCreate(ctx context.Context, id string) error {
resource, err := bkr.resourceService.Get(ctx, id)
if err != nil {
// if the resource is not found, it indicates the resource has been processed.
if err.Is404() {
return nil
}
return err
}

Expand All @@ -428,6 +432,10 @@ func (bkr *GRPCBroker) OnCreate(ctx context.Context, id string) error {
func (bkr *GRPCBroker) OnUpdate(ctx context.Context, id string) error {
resource, err := bkr.resourceService.Get(ctx, id)
if err != nil {
// if the resource is not found, it indicates the resource has been processed.
if err.Is404() {
return nil
}
return err
}

Expand All @@ -438,6 +446,10 @@ func (bkr *GRPCBroker) OnUpdate(ctx context.Context, id string) error {
func (bkr *GRPCBroker) OnDelete(ctx context.Context, id string) error {
resource, err := bkr.resourceService.Get(ctx, id)
if err != nil {
// if the resource is not found, it indicates the resource has been processed.
if err.Is404() {
return nil
}
return err
}

Expand Down

0 comments on commit eb7c030

Please sign in to comment.