Skip to content

Commit 07e0213

Browse files
committed
fix: the context Done chan should be closed when using verbose mode
1 parent bf1ad2b commit 07e0213

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pkg/commands/run.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -246,12 +246,11 @@ func (c *runCommand) execute(_ *cobra.Command, _ []string) {
246246
}
247247
}()
248248

249-
ctx := context.Background()
249+
ctx, cancel := context.WithCancel(context.Background())
250250
if c.cfg.Run.Timeout > 0 {
251-
var cancel context.CancelFunc
252251
ctx, cancel = context.WithTimeout(ctx, c.cfg.Run.Timeout)
253-
defer cancel()
254252
}
253+
defer cancel()
255254

256255
if needTrackResources {
257256
go watchResources(ctx, trackResourcesEndCh, c.log, c.debugf)

0 commit comments

Comments
 (0)