feat: support durable task cancellation without foreign keys

This commit is contained in:
2026-09-17 17:03:23 +08:00
parent 6805506450
commit 3ce7d2c104
48 changed files with 1642 additions and 164 deletions

View File

@@ -117,7 +117,7 @@ func (s *Service) Finish(ctx context.Context, t auth.Token, b Binding, message c
if err := validCommand(message, in.Ref); err != nil {
return CommandResult{}, err
}
if in.Outcome != "SUCCEEDED" && in.Outcome != "FAILED" && in.Outcome != "UNKNOWN" {
if in.Outcome != "SUCCEEDED" && in.Outcome != "FAILED" && in.Outcome != "UNKNOWN" && in.Outcome != "CANCELLED" {
return CommandResult{}, fault.Invalid("invalid result outcome")
}
if in.Retryable && in.Outcome != "FAILED" {
@@ -140,3 +140,7 @@ func (s *Service) Resume(ctx context.Context, t auth.Token, b Binding, ref Attem
}
return s.store.Resume(ctx, t, b, ref)
}
func (s *Service) Cancellations(ctx context.Context, t auth.Token, b Binding) ([]Cancellation, error) {
return s.store.Cancellations(ctx, t, b)
}