Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
Signed-off-by: Katrina Rogan <[email protected]>
  • Loading branch information
katrogan committed Nov 4, 2024
1 parent 7812061 commit 3f2f3fe
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion flyteadmin/pkg/repositories/gormimpl/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,6 @@ func applyScopedFilters(tx *gorm.DB, inlineFilters []common.InlineFilter, mapFil
return tx, nil
}

func getIdFilter(id uint) (query string, args interface{}) {
func getIDFilter(id uint) (query string, args interface{}) {
return fmt.Sprintf("%s = ?", ID), id
}
2 changes: 1 addition & 1 deletion flyteadmin/pkg/repositories/gormimpl/execution_repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (r *ExecutionRepo) Get(ctx context.Context, input interfaces.Identifier) (m

func (r *ExecutionRepo) Update(ctx context.Context, execution models.Execution) error {
timer := r.metrics.UpdateDuration.Start()
tx := r.db.WithContext(ctx).Model(&models.Execution{}).Where(getIdFilter(execution.ID)).Updates(execution)
tx := r.db.WithContext(ctx).Model(&models.Execution{}).Where(getIDFilter(execution.ID)).Updates(execution)
timer.Stop()
if err := tx.Error; err != nil {
return r.errorTransformer.ToFlyteAdminError(err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func (r *NodeExecutionRepo) GetWithChildren(ctx context.Context, input interface

func (r *NodeExecutionRepo) Update(ctx context.Context, nodeExecution *models.NodeExecution) error {
timer := r.metrics.UpdateDuration.Start()
tx := r.db.WithContext(ctx).Model(&models.NodeExecution{}).Where(getIdFilter(nodeExecution.ID)).Updates(nodeExecution)
tx := r.db.WithContext(ctx).Model(&models.NodeExecution{}).Where(getIDFilter(nodeExecution.ID)).Updates(nodeExecution)
timer.Stop()
if err := tx.Error; err != nil {
return r.errorTransformer.ToFlyteAdminError(err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (r *TaskExecutionRepo) Get(ctx context.Context, input interfaces.GetTaskExe

func (r *TaskExecutionRepo) Update(ctx context.Context, execution models.TaskExecution) error {
timer := r.metrics.UpdateDuration.Start()
tx := r.db.WithContext(ctx).Model(&models.TaskExecution{}).Where(getIdFilter(execution.ID)).
tx := r.db.WithContext(ctx).Model(&models.TaskExecution{}).Where(getIDFilter(execution.ID)).
Updates(&execution)
timer.Stop()

Expand Down

0 comments on commit 3f2f3fe

Please sign in to comment.