Skip to content

Commit 02fd2b4

Browse files
committed
Remove unused GetByPipelineIds method from WorkflowStatusLatestRepository to streamline repository interface.
1 parent 3bc8e3d commit 02fd2b4

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

internal/sql/repository/pipelineConfig/WorkflowStatusLatestRepository.go

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ type WorkflowStatusLatestRepository interface {
2828
UpdateCiWorkflowStatusLatest(model *CiWorkflowStatusLatest) error
2929
GetCiWorkflowStatusLatestByPipelineId(pipelineId int) (*CiWorkflowStatusLatest, error)
3030
GetCiWorkflowStatusLatestByAppId(appId int) ([]*CiWorkflowStatusLatest, error)
31-
GetByPipelineIds(pipelineIds []int) ([]int, error)
3231
GetCiWorkflowStatusLatestByPipelineIds(pipelineIds []int) ([]*CiWorkflowStatusLatest, error)
3332
DeleteCiWorkflowStatusLatestByPipelineId(pipelineId int) error
3433

@@ -129,23 +128,6 @@ func (impl *WorkflowStatusLatestRepositoryImpl) DeleteCiWorkflowStatusLatestByPi
129128
return nil
130129
}
131130

132-
func (impl *WorkflowStatusLatestRepositoryImpl) GetByPipelineIds(pipelineIds []int) ([]int, error) {
133-
if len(pipelineIds) == 0 {
134-
return []int{}, nil
135-
}
136-
137-
var cachedPipelineIds []int
138-
err := impl.dbConnection.Model(&CiWorkflowStatusLatest{}).
139-
Column("pipeline_id").
140-
Where("pipeline_id IN (?)", pg.In(pipelineIds)).
141-
Select(&cachedPipelineIds)
142-
if err != nil {
143-
impl.logger.Errorw("error in getting cached pipeline ids", "err", err, "pipelineIds", pipelineIds)
144-
return nil, err
145-
}
146-
return cachedPipelineIds, nil
147-
}
148-
149131
func (impl *WorkflowStatusLatestRepositoryImpl) GetCiWorkflowStatusLatestByPipelineIds(pipelineIds []int) ([]*CiWorkflowStatusLatest, error) {
150132
if len(pipelineIds) == 0 {
151133
return []*CiWorkflowStatusLatest{}, nil

0 commit comments

Comments
 (0)