Skip to content

Commit 19f6886

Browse files
committed
Rename GetCachedPipelineIds to GetByPipelineIds in WorkflowStatusLatestRepository and update references in CiHandlerImpl for clarity.
1 parent fc4c6aa commit 19f6886

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

internal/sql/repository/pipelineConfig/WorkflowStatusLatestRepository.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ type WorkflowStatusLatestRepository interface {
2828
UpdateCiWorkflowStatusLatest(model *CiWorkflowStatusLatest) error
2929
GetCiWorkflowStatusLatestByPipelineId(pipelineId int) (*CiWorkflowStatusLatest, error)
3030
GetCiWorkflowStatusLatestByAppId(appId int) ([]*CiWorkflowStatusLatest, error)
31-
GetCachedPipelineIds(pipelineIds []int) ([]int, error)
31+
GetByPipelineIds(pipelineIds []int) ([]int, error)
3232
GetCiWorkflowStatusLatestByPipelineIds(pipelineIds []int) ([]*CiWorkflowStatusLatest, error)
3333
DeleteCiWorkflowStatusLatestByPipelineId(pipelineId int) error
3434

@@ -129,7 +129,7 @@ func (impl *WorkflowStatusLatestRepositoryImpl) DeleteCiWorkflowStatusLatestByPi
129129
return nil
130130
}
131131

132-
func (impl *WorkflowStatusLatestRepositoryImpl) GetCachedPipelineIds(pipelineIds []int) ([]int, error) {
132+
func (impl *WorkflowStatusLatestRepositoryImpl) GetByPipelineIds(pipelineIds []int) ([]int, error) {
133133
if len(pipelineIds) == 0 {
134134
return []int{}, nil
135135
}

pkg/pipeline/CiHandler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ func (impl *CiHandlerImpl) FetchCiStatusForTriggerViewV1(appId int) ([]*pipeline
659659
}
660660

661661
// Find which pipeline IDs have entries in latest status table
662-
pipelinesInLatestTable, err := impl.workflowStatusLatestRepository.GetCachedPipelineIds(allPipelineIds)
662+
pipelinesInLatestTable, err := impl.workflowStatusLatestRepository.GetByPipelineIds(allPipelineIds)
663663
if err != nil {
664664
impl.Logger.Errorw("error in checking latest status table, falling back to old method", "err", err, "appId", appId)
665665
return impl.ciWorkflowRepository.FIndCiWorkflowStatusesByAppId(appId)
@@ -788,7 +788,7 @@ func (impl *CiHandlerImpl) fetchLastTriggeredWorkflowsHybrid(pipelineIds []int)
788788
}
789789

790790
// Find which pipeline IDs have entries in latest status table
791-
pipelinesInLatestTable, err := impl.workflowStatusLatestRepository.GetCachedPipelineIds(pipelineIds)
791+
pipelinesInLatestTable, err := impl.workflowStatusLatestRepository.GetByPipelineIds(pipelineIds)
792792
if err != nil {
793793
impl.Logger.Errorw("error in checking latest status table, falling back to complex query", "err", err, "pipelineIds", pipelineIds)
794794
return impl.ciWorkflowRepository.FindLastTriggeredWorkflowByCiIds(pipelineIds)

0 commit comments

Comments
 (0)