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

abeizn pushed a commit to branch release-v0.19
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/release-v0.19 by this push:
     new e70c41903 fix(pipeline): fix potiential panic (#6487)
e70c41903 is described below

commit e70c41903bb3a771e459aafa7e0110d1d84be715
Author: Lynwee <[email protected]>
AuthorDate: Mon Nov 20 21:20:17 2023 +0800

    fix(pipeline): fix potiential panic (#6487)
---
 backend/core/runner/run_pipeline.go | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/backend/core/runner/run_pipeline.go 
b/backend/core/runner/run_pipeline.go
index 20816de7e..24a07453b 100644
--- a/backend/core/runner/run_pipeline.go
+++ b/backend/core/runner/run_pipeline.go
@@ -68,6 +68,11 @@ func runPipelineTasks(
                return err
        }
 
+       // if pipeline has been cancelled, just return.
+       if dbPipeline.Status == models.TASK_CANCELLED {
+               return nil
+       }
+
        // This double for loop executes each set of tasks sequentially while
        // executing the set of tasks concurrently.
        for i, row := range taskIds {
@@ -90,6 +95,10 @@ func runPipelineTasks(
                        }
                }
        }
-       log.Info("pipeline finished in %d ms: %v", 
time.Now().UnixMilli()-dbPipeline.BeganAt.UnixMilli(), err)
+       if dbPipeline.BeganAt != nil {
+               log.Info("pipeline finished in %d ms: %v", 
time.Now().UnixMilli()-dbPipeline.BeganAt.UnixMilli(), err)
+       } else {
+               log.Info("pipeline finished at %d ms: %v", 
time.Now().UnixMilli(), err)
+       }
        return err
 }

Reply via email to