Skip to content

Commit

Permalink
Use the available context
Browse files Browse the repository at this point in the history
  • Loading branch information
chriso committed Jun 28, 2024
1 parent 027e978 commit d4984b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/fanout/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import (

func main() {
getRepo := dispatch.Func("getRepo", func(ctx context.Context, name string) (*dispatchhttp.Response, error) {
return dispatchhttp.Get(context.Background(), "https://api.github.com/repos/dispatchrun/"+name)
return dispatchhttp.Get(ctx, "https://api.github.com/repos/dispatchrun/"+name)
})

getStargazers := dispatch.Func("getStargazers", func(ctx context.Context, url string) (*dispatchhttp.Response, error) {
return dispatchhttp.Get(context.Background(), url)
return dispatchhttp.Get(ctx, url)
})

reduceStargazers := dispatch.Func("reduceStargazers", func(ctx context.Context, stargazerURLs []string) ([]string, error) {
Expand Down

0 comments on commit d4984b4

Please sign in to comment.