Skip to content

Commit b198df8

Browse files
committed
feat: disable timeout if timeout <= 0
1 parent 0c6bccb commit b198df8

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

pkg/commands/run.go

+8-2
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,14 @@ func (c *runCommand) execute(_ *cobra.Command, args []string) {
244244
}
245245
}()
246246

247-
ctx, cancel := context.WithTimeout(context.Background(), c.cfg.Run.Timeout)
248-
defer cancel()
247+
var ctx context.Context
248+
if c.cfg.Run.Timeout > 0 {
249+
var cancel context.CancelFunc
250+
ctx, cancel = context.WithTimeout(context.Background(), c.cfg.Run.Timeout)
251+
defer cancel()
252+
} else {
253+
ctx = context.Background()
254+
}
249255

250256
if needTrackResources {
251257
go watchResources(ctx, trackResourcesEndCh, c.log, c.debugf)

0 commit comments

Comments
 (0)