Skip to content
This repository was archived by the owner on Apr 2, 2026. It is now read-only.

Commit 38bf5e9

Browse files
github-actions[bot]greynewellclaudeclaude[bot]
committed
fix: cancel in-flight GetCircularDependencies request when GetGraph fails
Derive a cancellable context at the top of fetchGraphWithCircularDeps and use defer cancel() so that the in-flight HTTP request to the circular- dependencies API endpoint is aborted as soon as GetGraph returns an error, avoiding wasted network bandwidth and API quota. Fixes #78 Co-Authored-By: Grey Newell <greyshipscode@gmail.com> Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: claude[bot] <claude[bot]@users.noreply.github.com>
1 parent 9f3b5fd commit 38bf5e9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cmd/run.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,9 @@ func fetchGraphWithCircularDeps(
268268
repoZip []byte,
269269
logFn func(string, ...interface{}),
270270
) (*api.ProjectGraph, error) {
271+
ctx, cancel := context.WithCancel(ctx)
272+
defer cancel()
273+
271274
type graphResult struct {
272275
graph *api.ProjectGraph
273276
err error

0 commit comments

Comments
 (0)