Skip to content

Commit 3238fc4

Browse files
authored
fix: notify pipeline started after status change committed (#8526)
#8525
1 parent 2d8cca1 commit 3238fc4

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

backend/server/services/pipeline.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -293,13 +293,6 @@ func dequeuePipeline(runningParallelLabels []string) (pipeline *models.Pipeline,
293293
panic(err)
294294
}
295295

296-
// Notify that the pipeline has started
297-
go func(pipelineId uint64) {
298-
if notifyErr := NotifyExternal(pipelineId); notifyErr != nil {
299-
globalPipelineLog.Error(notifyErr, "failed to send pipeline started notification for pipeline #%d", pipelineId)
300-
}
301-
}(pipeline.ID)
302-
303296
return
304297
}
305298
if tx.IsErrorNotFound(err) {
@@ -357,6 +350,11 @@ func RunPipelineInQueue(pipelineMaxParallel int64) {
357350
globalPipelineLog.Info("finish pipeline #%d, now runningParallelLabels is %s", pipelineId, runningParallelLabels)
358351
}()
359352
globalPipelineLog.Info("run pipeline, %d, now running runningParallelLabels are %s", pipelineId, runningParallelLabels)
353+
// Notify that the pipeline has started
354+
err = NotifyExternal(pipelineId)
355+
if err != nil {
356+
globalPipelineLog.Error(err, "failed to send pipeline started notification for pipeline #%d", pipelineId)
357+
}
360358
err = runPipeline(pipelineId)
361359
if err != nil {
362360
globalPipelineLog.Error(err, "failed to run pipeline %d", pipelineId)

0 commit comments

Comments
 (0)