From e1a6cf5d07b30679c70c8f2db6557d3ddc47d08e Mon Sep 17 00:00:00 2001 From: Jarvis Date: Wed, 25 Feb 2026 16:20:17 -0600 Subject: [PATCH] test(agentic): batch probe #15 (errgroup) --- internal/handler/agentic_probe_batch_15.go | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 internal/handler/agentic_probe_batch_15.go diff --git a/internal/handler/agentic_probe_batch_15.go b/internal/handler/agentic_probe_batch_15.go new file mode 100644 index 0000000..8647258 --- /dev/null +++ b/internal/handler/agentic_probe_batch_15.go @@ -0,0 +1,24 @@ +package handler + +import ( + "context" + "net/http" + "time" + + "golang.org/x/sync/errgroup" +) + +func AgenticProbeBatch15(w http.ResponseWriter, r *http.Request) error { + g, _ := errgroup.WithContext(r.Context()) + for i := 0; i < 3; i++ { + g.Go(func() error { + select { + case <-time.After(150 * time.Millisecond): + return nil + case <-context.Background().Done(): + return nil + } + }) + } + return g.Wait() +}