Track data race error

Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
This commit is contained in:
Tom Chauveau 2021-08-19 20:10:33 +02:00
parent 970a1988eb
commit 22a9445455
No known key found for this signature in database
GPG Key ID: 3C9847D981AAC1BF

View File

@ -139,11 +139,20 @@ func (c *Client) buildfn(ctx context.Context, st *state.State, env *environment.
Interface("attrs", opts.FrontendAttrs). Interface("attrs", opts.FrontendAttrs).
Msg("spawning buildkit job") Msg("spawning buildkit job")
solverCh := make(chan *bk.SolveStatus)
defer close(solverCh)
go func() {
for e := range solverCh {
fmt.Println("J'envoie un event depuis pushContainer")
ch <- e
}
}()
resp, err := c.c.Build(ctx, opts, "", func(ctx context.Context, gw bkgw.Client) (*bkgw.Result, error) { resp, err := c.c.Build(ctx, opts, "", func(ctx context.Context, gw bkgw.Client) (*bkgw.Result, error) {
s := solver.New(solver.Opts{ s := solver.New(solver.Opts{
Control: c.c, Control: c.c,
Gateway: gw, Gateway: gw,
Events: ch, Events: solverCh,
Auth: auth, Auth: auth,
Secrets: secrets, Secrets: secrets,
NoCache: c.cfg.NoCache, NoCache: c.cfg.NoCache,