feat(worker): allow cancelling a WaitingForChildren parent

Add WaitingForChildren to the CancelAsync guard so a parent waiting on its
children can be cancelled.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
mika kuns
2026-06-09 11:44:18 +02:00
parent a8b86e25e6
commit d6e0953293
2 changed files with 23 additions and 1 deletions

View File

@@ -219,7 +219,8 @@ public sealed class TaskStateService : ITaskStateService
var affected = await ctx.Tasks
.Where(t => t.Id == taskId &&
(t.Status == TaskStatus.Running || t.Status == TaskStatus.Queued
|| t.Status == TaskStatus.WaitingForReview))
|| t.Status == TaskStatus.WaitingForReview
|| t.Status == TaskStatus.WaitingForChildren))
.ExecuteUpdateAsync(s => s
.SetProperty(t => t.Status, TaskStatus.Cancelled)
.SetProperty(t => t.FinishedAt, finishedAt), ct);