MCPcopy Index your code
hub / github.com/bytebase/bytebase / UpdateTaskRunStatus

Method UpdateTaskRunStatus

backend/store/task_run.go:208–224  ·  view source on GitHub ↗

UpdateTaskRunStatus updates task run status.

(ctx context.Context, patch *TaskRunStatusPatch)

Source from the content-addressed store, hash-verified

206
207// UpdateTaskRunStatus updates task run status.
208func (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.
227type ClaimedTaskRun struct {

Callers 4

failTaskRunsForHAMethod · 0.80
executeTaskRunMethod · 0.80
runTaskRunOnceMethod · 0.80
promoteTaskRunMethod · 0.80

Calls 2

GetDBMethod · 0.95

Tested by

no test coverage detected