mirror of
https://github.com/Ed1s0nZ/CyberStrikeAI.git
synced 2026-10-21 23:01:37 +02:00
fix: distinguish task deadlines from child operation timeouts
This commit is contained in:
1 parent
93e8684571
commit
5ff781bdb7
7 files changed
+134
-4
No files matched your search
@@ -0,0 +1,13 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
)
|
||||
|
||||
// taskDeadlineExceeded distinguishes the task's deadline from a child operation's
|
||||
// timeout. A run error (including a cancellation cause) may wrap DeadlineExceeded
|
||||
// while the task itself still has time remaining; it must not exhaust the task budget.
|
||||
func taskDeadlineExceeded(taskCtx context.Context) bool {
|
||||
return taskCtx != nil && errors.Is(taskCtx.Err(), context.DeadlineExceeded)
|
||||
}
|
||||
Reference in new issue
Block a user