From 3d65d114d8258a996343d11bc549b5d20ceda746 Mon Sep 17 00:00:00 2001 From: Katrina Rogan Date: Thu, 31 Oct 2024 19:50:09 +0100 Subject: [PATCH] Use id in queries Signed-off-by: Katrina Rogan --- flyteadmin/pkg/repositories/gormimpl/task_execution_repo.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flyteadmin/pkg/repositories/gormimpl/task_execution_repo.go b/flyteadmin/pkg/repositories/gormimpl/task_execution_repo.go index c42d36b1bc..fde2e06e3d 100644 --- a/flyteadmin/pkg/repositories/gormimpl/task_execution_repo.go +++ b/flyteadmin/pkg/repositories/gormimpl/task_execution_repo.go @@ -81,7 +81,8 @@ 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).WithContext(ctx).Save(&execution) + tx := r.db.WithContext(ctx).WithContext(ctx).Model(&models.TaskExecution{}) + tx = tx.Where("id = ?", execution.ID).Updates(&execution) timer.Stop() if err := tx.Error; err != nil {