You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by kl...@apache.org on 2023/06/28 01:58:54 UTC

[incubator-devlake] branch main updated: fix: cancel doesn't work (#5586)

This is an automated email from the ASF dual-hosted git repository.

klesh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/main by this push:
     new fe7b51693 fix: cancel doesn't work (#5586)
fe7b51693 is described below

commit fe7b5169312509baddc4292cba6319cd16617247
Author: Liang Zhang <li...@merico.dev>
AuthorDate: Wed Jun 28 09:58:50 2023 +0800

    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 75bb910f1..d87468fee 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
 		}
 	}()