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

narro pushed a commit to branch fix-#8525
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git

commit 90aedb3913e3a83e0a0dfc0daf655c7ef3940e30
Author: narro wizard <cong.w...@merico.dev>
AuthorDate: Tue Aug 5 08:38:33 2025 +0000

    fix: notify pipeline started after status change committed
    
    #8525
---
 backend/server/services/pipeline.go | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/backend/server/services/pipeline.go 
b/backend/server/services/pipeline.go
index 5c5fcca62..413ba3db6 100644
--- a/backend/server/services/pipeline.go
+++ b/backend/server/services/pipeline.go
@@ -293,13 +293,6 @@ func dequeuePipeline(runningParallelLabels []string) 
(pipeline *models.Pipeline,
                        panic(err)
                }
 
-               // Notify that the pipeline has started
-               go func(pipelineId uint64) {
-                       if notifyErr := NotifyExternal(pipelineId); notifyErr 
!= nil {
-                               globalPipelineLog.Error(notifyErr, "failed to 
send pipeline started notification for pipeline #%d", pipelineId)
-                       }
-               }(pipeline.ID)
-
                return
        }
        if tx.IsErrorNotFound(err) {
@@ -357,6 +350,11 @@ func RunPipelineInQueue(pipelineMaxParallel int64) {
                                globalPipelineLog.Info("finish pipeline #%d, 
now runningParallelLabels is %s", pipelineId, runningParallelLabels)
                        }()
                        globalPipelineLog.Info("run pipeline, %d, now running 
runningParallelLabels are %s", pipelineId, runningParallelLabels)
+                       // Notify that the pipeline has started
+                       err = NotifyExternal(pipelineId)
+                       if err != nil {
+                               globalPipelineLog.Error(err, "failed to send 
pipeline started notification for pipeline #%d", pipelineId)
+                       }
                        err = runPipeline(pipelineId)
                        if err != nil {
                                globalPipelineLog.Error(err, "failed to run 
pipeline %d", pipelineId)

Reply via email to