From 765e57060dab1a30a46b7dc5816d9761c4637a54 Mon Sep 17 00:00:00 2001 From: Gabriel Paradiso Date: Thu, 19 Dec 2024 12:25:34 +0100 Subject: [PATCH] chore: add warning if workflow is not found --- core/services/workflows/syncer/handler.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/services/workflows/syncer/handler.go b/core/services/workflows/syncer/handler.go index a4be3a69c29..cb4f013d502 100644 --- a/core/services/workflows/syncer/handler.go +++ b/core/services/workflows/syncer/handler.go @@ -644,9 +644,14 @@ func (h *eventHandler) workflowDeletedEvent( } err := h.orm.DeleteWorkflowSpec(ctx, hex.EncodeToString(payload.WorkflowOwner), payload.WorkflowName) - if err != nil && !errors.Is(err, sql.ErrNoRows) { + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + h.lggr.Warnw("workflow spec not found", "workflowID", hex.EncodeToString(payload.WorkflowID[:])) + return nil + } return fmt.Errorf("failed to delete workflow spec: %w", err) } + return nil }