mirror of
https://github.com/Ed1s0nZ/CyberStrikeAI.git
synced 2026-07-14 16:07:34 +02:00
13 lines
355 B
Go
13 lines
355 B
Go
package handler
|
|
|
|
import "context"
|
|
|
|
// detachedAgentContext lets a long-running Agent survive an SSE disconnect
|
|
// while retaining immutable request values such as the authenticated Principal.
|
|
func detachedAgentContext(parent context.Context) context.Context {
|
|
if parent == nil {
|
|
parent = context.Background()
|
|
}
|
|
return context.WithoutCancel(parent)
|
|
}
|