Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
matt2e committed Jan 7, 2025
1 parent 7c18ab7 commit d6c129c
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions backend/provisioner/inmem_provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
schemapb "github.com/block/ftl/common/protos/xyz/block/ftl/schema/v1"
"github.com/block/ftl/common/schema"
"github.com/block/ftl/common/slices"
"github.com/block/ftl/internal/channels"
"github.com/block/ftl/internal/log"
)

Expand Down Expand Up @@ -136,20 +137,15 @@ func (d *InMemProvisioner) Provision(ctx context.Context, req *connect.Request[p
}

go func() {
for {
for c := range channels.IterContext(ctx, completions) {
if e, ok := c.event.Get(); ok {
task.events = append(task.events, e)
}
c.step.Done.Store(true)
done, err := task.Done()
if done || err != nil {
return
}
select {
case <-ctx.Done():
return
case c := <-completions:
if e, ok := c.event.Get(); ok {
task.events = append(task.events, e)
}
c.step.Done.Store(true)
}
}
}()

Expand Down

0 comments on commit d6c129c

Please sign in to comment.