Skip to content

Commit

Permalink
rerun and rerun failed pipeline don't use cron time (#2560)
Browse files Browse the repository at this point in the history
  • Loading branch information
chengjoey authored Oct 27, 2021
1 parent 84323a6 commit 48c906c
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions modules/pipeline/services/pipelinesvc/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,13 @@ func (s *PipelineSvc) ConvertPipeline(p *spec.Pipeline) *apistructs.PipelineDTO

// from extra
if p.TriggerMode == apistructs.PipelineTriggerModeCron && p.Extra.CronTriggerTime != nil {
result.TimeCreated = p.Extra.CronTriggerTime
result.TimeBegin = p.Extra.CronTriggerTime
// if pipeline is rerun and rerun failed, don't need to convert trigger time
pipelineType := p.Labels[apistructs.LabelPipelineType]
if pipelineType != apistructs.PipelineTypeRerun.String() &&
pipelineType != apistructs.PipelineTypeRerunFailed.String() {
result.TimeCreated = p.Extra.CronTriggerTime
result.TimeBegin = p.Extra.CronTriggerTime
}
}
result.Namespace = p.Extra.Namespace
result.OrgName = p.GetOrgName()
Expand Down Expand Up @@ -122,8 +127,12 @@ func (s *PipelineSvc) Convert2PagePipeline(p *spec.Pipeline) *apistructs.PagePip
TimeUpdated: p.TimeUpdated,
}
if p.TriggerMode == apistructs.PipelineTriggerModeCron && p.Extra.CronTriggerTime != nil {
result.TimeCreated = p.Extra.CronTriggerTime
result.TimeBegin = p.Extra.CronTriggerTime
pipelineType := p.Labels[apistructs.LabelPipelineType]
if pipelineType != apistructs.PipelineTypeRerun.String() &&
pipelineType != apistructs.PipelineTypeRerunFailed.String() {
result.TimeCreated = p.Extra.CronTriggerTime
result.TimeBegin = p.Extra.CronTriggerTime
}
}
return &result
}
Expand Down

0 comments on commit 48c906c

Please sign in to comment.