feat: support durable task cancellation without foreign keys
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"git.yuntuo.hk/k2safe/orbit/internal/fault"
|
||||
core "git.yuntuo.hk/k2safe/orbit/model"
|
||||
"git.yuntuo.hk/k2safe/orbit/platform/auth"
|
||||
pulse "git.yuntuo.hk/k2safe/orbit/pulse/model"
|
||||
@@ -62,6 +63,9 @@ func (s *ExecutionStore) Finish(ctx context.Context, token auth.Token, b worker.
|
||||
out = worker.CommandResult{Receipt: receipt, Lease: status, Deduplicated: true}
|
||||
return nil
|
||||
}
|
||||
if in.Outcome == "CANCELLED" && task.view.CancelRequestedAt == nil {
|
||||
return fault.Conflict
|
||||
}
|
||||
reason := ""
|
||||
if a.ResultDigest != nil {
|
||||
reason = "RESULT_CONFLICT"
|
||||
|
||||
Reference in New Issue
Block a user