Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions backend/server/services/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,14 @@ func dequeuePipeline(runningParallelLabels []string) (pipeline *models.Pipeline,
if err != nil {
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) {
Expand Down Expand Up @@ -363,6 +371,7 @@ func getProjectName(pipeline *models.Pipeline) (string, errors.Error) {
}
blueprintId := pipeline.BlueprintId
if blueprintId == 0 {
// skip get project name if pipeline is not bound to a blueprint
return "", nil
}
dbBlueprint := &models.Blueprint{}
Expand Down
8 changes: 8 additions & 0 deletions backend/server/services/pipeline_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,14 @@ func CreateDbPipeline(newPipeline *models.NewPipeline) (pipeline *models.Pipelin
// update tasks state
errors.Must(tx.Update(dbPipeline))
dbPipeline.Labels = newPipeline.Labels

// Notify that the pipeline has been created
go func(pipelineId uint64) {
if notifyErr := NotifyExternal(pipelineId); notifyErr != nil {
globalPipelineLog.Error(notifyErr, "failed to send pipeline created notification for pipeline #%d", pipelineId)
}
}(dbPipeline.ID)

return dbPipeline, nil
}

Expand Down
Loading