Skip to content

Commit e311605

Browse files
committed
chore: use context in more workflows
1 parent 85d19c3 commit e311605

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

pkg/local_workflows/ignore_workflow/ignore_workflow.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ func sendCreateIgnore(invocationCtx workflow.InvocationContext, input policyApi.
348348
return nil, err
349349
}
350350

351-
ctx, cancelFunc := context.WithTimeout(context.Background(), policyApiTimeout)
351+
ctx, cancelFunc := context.WithTimeout(invocationCtx.Context(), policyApiTimeout)
352352
defer cancelFunc()
353353

354354
resp, err := client.CreateOrgPolicyWithApplicationVndAPIPlusJSONBody(ctx, orgUuid, &params, input)

pkg/local_workflows/output_workflow/findings_model_tools.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package output_workflow
22

33
import (
4-
"context"
54
"encoding/json"
65
"fmt"
76
"strings"
@@ -117,7 +116,7 @@ func HandleContentTypeFindingsModel(input []workflow.Data, invocation workflow.I
117116
writerMap := applyTemplatesToWriters(supportedMimeTypes, writers)
118117

119118
// iterate over all writers and render for each of them
120-
ctx := context.Background()
119+
ctx := invocation.Context()
121120
availableThreads := semaphore.NewWeighted(threadCount)
122121
for k, v := range writerMap {
123122
err = availableThreads.Acquire(ctx, 1)

pkg/local_workflows/output_workflow/ufm_tools.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package output_workflow
22

33
import (
4-
"context"
54
"errors"
65
"sync"
76

@@ -111,7 +110,7 @@ func HandleContentTypeUnifiedModel(input []workflow.Data, invocation workflow.In
111110
writerMap := applyTemplatesToWriters(supportedMimeTypes, writers)
112111

113112
// iterate over all writers and render for each of them
114-
ctx := context.Background()
113+
ctx := invocation.Context()
115114
availableThreads := semaphore.NewWeighted(threadCount)
116115
var errMu sync.Mutex
117116
var errs []error

0 commit comments

Comments
 (0)