UpdateTaskRunStatus updates task run status.
(ctx context.Context, patch *TaskRunStatusPatch)
| 206 | |
| 207 | // UpdateTaskRunStatus updates task run status. |
| 208 | func (s *Store) UpdateTaskRunStatus(ctx context.Context, patch *TaskRunStatusPatch) (*TaskRunMessage, error) { |
| 209 | tx, err := s.GetDB().BeginTx(ctx, nil) |
| 210 | if err != nil { |
| 211 | return nil, errors.Wrapf(err, "failed to begin tx") |
| 212 | } |
| 213 | defer tx.Rollback() |
| 214 | |
| 215 | taskRun, err := s.patchTaskRunStatusImpl(ctx, tx, patch) |
| 216 | if err != nil { |
| 217 | return nil, errors.Wrapf(err, "failed to update task run") |
| 218 | } |
| 219 | |
| 220 | if err := tx.Commit(); err != nil { |
| 221 | return nil, errors.Wrapf(err, "failed to commit tx") |
| 222 | } |
| 223 | return taskRun, nil |
| 224 | } |
| 225 | |
| 226 | // ClaimedTaskRun represents a claimed task run with its task UID. |
| 227 | type ClaimedTaskRun struct { |
no test coverage detected