From 24d9b26f81961875821aeccf200d35c98c325a31 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Wed, 28 Jun 2023 09:58:50 +0800 Subject: [PATCH] fix: cancel doesn't work (#5586) --- backend/core/runner/run_task.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/backend/core/runner/run_task.go b/backend/core/runner/run_task.go index 75bb910f190..d87468feeb7 100644 --- a/backend/core/runner/run_task.go +++ b/backend/core/runner/run_task.go @@ -20,6 +20,8 @@ package runner import ( gocontext "context" "fmt" + "time" + "github.com/apache/incubator-devlake/core/context" "github.com/apache/incubator-devlake/core/dal" "github.com/apache/incubator-devlake/core/errors" @@ -30,7 +32,6 @@ import ( "github.com/apache/incubator-devlake/helpers/pluginhelper/api" contextimpl "github.com/apache/incubator-devlake/impls/context" "github.com/apache/incubator-devlake/impls/logruslog" - "time" ) // RunTask FIXME ... @@ -113,8 +114,8 @@ func RunTask( if dbe != nil { logger.Error(dbe, "update pipeline state failed") } - // not return err if the `SkipOnFail` is true - if dbPipeline.SkipOnFail { + // not return err if the `SkipOnFail` is true and the error is not canceled + if dbPipeline.SkipOnFail && !errors.Is(err, gocontext.Canceled) { err = nil } }()