@@ -97,7 +97,7 @@ type PipelineRepository interface {
97
97
FindNumberOfAppsWithCdPipeline (appIds []int ) (count int , err error )
98
98
GetAppAndEnvDetailsForDeploymentAppTypePipeline (deploymentAppType string , clusterIds []int ) ([]* Pipeline , error )
99
99
GetArgoPipelinesHavingTriggersStuckInLastPossibleNonTerminalTimelines (pendingSinceSeconds int , timeForDegradation int ) ([]* Pipeline , error )
100
- GetArgoPipelinesHavingLatestTriggerStuckInNonTerminalStatuses (deployedBeforeMinutes int ) ([]* Pipeline , error )
100
+ GetArgoPipelinesHavingLatestTriggerStuckInNonTerminalStatuses (deployedBeforeMinutes int , getPipelineDeployedWithinHours int ) ([]* Pipeline , error )
101
101
FindIdsByAppIdsAndEnvironmentIds (appIds , environmentIds []int ) (ids []int , err error )
102
102
FindIdsByProjectIdsAndEnvironmentIds (projectIds , environmentIds []int ) ([]int , error )
103
103
@@ -524,16 +524,16 @@ func (impl PipelineRepositoryImpl) GetArgoPipelinesHavingTriggersStuckInLastPoss
524
524
return pipelines , nil
525
525
}
526
526
527
- func (impl PipelineRepositoryImpl ) GetArgoPipelinesHavingLatestTriggerStuckInNonTerminalStatuses (deployedBeforeMinutes int ) ([]* Pipeline , error ) {
527
+ func (impl PipelineRepositoryImpl ) GetArgoPipelinesHavingLatestTriggerStuckInNonTerminalStatuses (getPipelineDeployedBeforeMinutes int , getPipelineDeployedWithinHours int ) ([]* Pipeline , error ) {
528
528
var pipelines []* Pipeline
529
529
queryString := `select p.* from pipeline p inner join cd_workflow cw on cw.pipeline_id = p.id
530
530
inner join cd_workflow_runner cwr on cwr.cd_workflow_id=cw.id
531
531
where cwr.id in (select id from cd_workflow_runner
532
- where started_on < NOW() - INTERVAL '? minutes' and status not in (?)
532
+ where started_on < NOW() - INTERVAL '? minutes' and started_on > NOW() - INTERVAL '? hours' and status not in (?)
533
533
and workflow_type=? and cd_workflow_id in (select DISTINCT ON (pipeline_id) max(id) as id from cd_workflow
534
534
group by pipeline_id, id order by pipeline_id, id desc))
535
535
and p.deployment_app_type=? and p.deleted=?;`
536
- _ , err := impl .dbConnection .Query (& pipelines , queryString , deployedBeforeMinutes ,
536
+ _ , err := impl .dbConnection .Query (& pipelines , queryString , getPipelineDeployedBeforeMinutes , getPipelineDeployedWithinHours ,
537
537
pg .In ([]string {WorkflowAborted , WorkflowFailed , WorkflowSucceeded , string (health .HealthStatusHealthy ), string (health .HealthStatusDegraded )}),
538
538
bean .CD_WORKFLOW_TYPE_DEPLOY , util .PIPELINE_DEPLOYMENT_TYPE_ACD , false )
539
539
if err != nil {
0 commit comments