Skip to content

Commit c401550

Browse files
committed
added timeout to upload task
Signed-off-by: Tim Ramlot <[email protected]>
1 parent a6b5795 commit c401550

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/agent/run.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,10 @@ func gatherAndOutputData(ctx context.Context, eventf Eventf, config CombinedConf
335335
})
336336

337337
post := func() (any, error) {
338-
return struct{}{}, postData(klog.NewContext(ctx, log), config, preflightClient, readings)
338+
postCtx, cancel := context.WithTimeout(ctx, config.BackoffMaxTime)
339+
defer cancel()
340+
341+
return struct{}{}, postData(klog.NewContext(postCtx, log), config, preflightClient, readings)
339342
}
340343

341344
group.Go(func() error {

0 commit comments

Comments
 (0)