Skip to content

Commit

Permalink
Merge pull request #1053 from jonjohnsonjr/cpuuusage
Browse files Browse the repository at this point in the history
Fix resource usage in melange
  • Loading branch information
jonjohnsonjr committed Feb 29, 2024
2 parents 4678d38 + 67f2fe9 commit 2057bee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion internal/contextreader/contextreader.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func (c *contextReader) init() {
c.n, c.err = c.r.Read(p)
c.done <- struct{}{}
case <-c.ctx.Done():
break
return
}
}
}()
Expand Down
2 changes: 2 additions & 0 deletions pkg/container/docker/docker_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ func (dk *docker) waitForCommand(ctx context.Context, r io.Reader) error {
defer stderr.Close()

// Wrap this in a contextReader so we respond to cancel.
ctx, cancel := context.WithCancel(ctx)
defer cancel()
ctxr := contextreader.New(ctx, r)

_, err := stdcopy.StdCopy(stdout, stderr, ctxr)
Expand Down

0 comments on commit 2057bee

Please sign in to comment.