Skip to content

Commit

Permalink
dockerui: use CachedGroup in dockerui context resolve
Browse files Browse the repository at this point in the history
Signed-off-by: Tonis Tiigi <[email protected]>
  • Loading branch information
tonistiigi committed Jun 12, 2024
1 parent 53fc6e6 commit f15779d
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions frontend/dockerui/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ type Client struct {
Config
client client.Client
ignoreCache []string
bctx *buildContext
g flightcontrol.Group[*buildContext]
g flightcontrol.CachedGroup[*buildContext]
bopts client.BuildOpts

dockerignore []byte
Expand Down Expand Up @@ -288,14 +287,7 @@ func (bc *Client) init() error {

func (bc *Client) buildContext(ctx context.Context) (*buildContext, error) {
return bc.g.Do(ctx, "initcontext", func(ctx context.Context) (*buildContext, error) {
if bc.bctx != nil {
return bc.bctx, nil
}
bctx, err := bc.initContext(ctx)
if err == nil {
bc.bctx = bctx
}
return bctx, err
return bc.initContext(ctx)
})
}

Expand Down

0 comments on commit f15779d

Please sign in to comment.