BatchCancelPlanCheckRuns updates the status of planCheckRuns to CANCELED.
(ctx context.Context, projectID string, planCheckRunUIDs []int64)
| 209 | |
| 210 | // BatchCancelPlanCheckRuns updates the status of planCheckRuns to CANCELED. |
| 211 | func (s *Store) BatchCancelPlanCheckRuns(ctx context.Context, projectID string, planCheckRunUIDs []int64) error { |
| 212 | q := qb.Q().Space(` |
| 213 | UPDATE plan_check_run |
| 214 | SET |
| 215 | status = ?, |
| 216 | updated_at = ? |
| 217 | WHERE id = ANY(?) AND project = ?`, PlanCheckRunStatusCanceled, time.Now(), planCheckRunUIDs, projectID) |
| 218 | query, args, err := q.ToSQL() |
| 219 | if err != nil { |
| 220 | return errors.Wrapf(err, "failed to build sql") |
| 221 | } |
| 222 | if _, err := s.GetDB().ExecContext(ctx, query, args...); err != nil { |
| 223 | return err |
| 224 | } |
| 225 | return nil |
| 226 | } |
| 227 | |
| 228 | // ClaimedPlanCheckRun represents a plan check run that was atomically claimed. |
| 229 | type ClaimedPlanCheckRun struct { |
no test coverage detected