mirror of
https://github.com/Ed1s0nZ/CyberStrikeAI.git
synced 2026-10-19 22:17:42 +02:00
15 lines
388 B
Go
15 lines
388 B
Go
package mcp
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
)
|
|
|
|
type toolExecutionDeadlineKey struct{}
|
|
|
|
// WithToolExecutionDeadline sets an execution limit independently of a caller's
|
|
// bounded wait. Detached workers retain this explicit limit.
|
|
func WithToolExecutionDeadline(ctx context.Context, deadline time.Time) context.Context {
|
|
return context.WithValue(ctx, toolExecutionDeadlineKey{}, deadline)
|
|
}
|