MCPcopy Create free account
hub / github.com/compozy/agh / DeleteTask

Method DeleteTask

internal/task/manager.go:405–422  ·  view source on GitHub ↗

DeleteTask removes one task after verifying it is not still in use by child tasks or non-terminal runs, then reconciles any dependents unblocked by the cascade-deleted dependency edges.

(ctx context.Context, id string, actor ActorContext)

Source from the content-addressed store, hash-verified

403// tasks or non-terminal runs, then reconciles any dependents unblocked by the
404// cascade-deleted dependency edges.
405func (m *Service) DeleteTask(ctx context.Context, id string, actor ActorContext) error {
406 if err := requireWriteAuthority(actor); err != nil {
407 return err
408 }
409
410 trimmedID := strings.TrimSpace(id)
411 if trimmedID == "" {
412 return fmt.Errorf("%w: task id is required", ErrValidation)
413 }
414
415 if txStore, ok := m.store.(DeleteTaskTransactionStore); ok {
416 return txStore.WithDeleteTaskTransaction(ctx, func(store DeleteTaskMutationStore) error {
417 return m.deleteTaskWithStore(ctx, store, trimmedID)
418 })
419 }
420
421 return m.deleteTaskWithStore(ctx, m.store, trimmedID)
422}
423
424func (m *Service) deleteTaskWithStore(
425 ctx context.Context,

Callers

nothing calls this directly

Calls 3

deleteTaskWithStoreMethod · 0.95
requireWriteAuthorityFunction · 0.85

Tested by

no test coverage detected