Skip to content

Commit

Permalink
Merge pull request #509 from asteris-llc/fix/plan-race-condition
Browse files Browse the repository at this point in the history
move rendering plant creation inside of the transform block to avoid …
  • Loading branch information
arichardet authored Nov 17, 2016
2 parents 5c96046 + caa84f6 commit 028d27d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions plan/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,12 @@ func Plan(ctx context.Context, in *graph.Graph) (*graph.Graph, error) {
func WithNotify(ctx context.Context, in *graph.Graph, notify *graph.Notifier) (*graph.Graph, error) {
var hasErrors error

renderingPlant, err := render.NewFactory(ctx, in)
if err != nil {
return nil, err
}

out, err := in.Transform(ctx,
notify.Transform(func(meta *node.Node, out *graph.Graph) error {
renderingPlant, err := render.NewFactory(ctx, in)
if err != nil {
return err
}
renderingPlant.Graph = out

pipeline := Pipeline(ctx, out, meta.ID, renderingPlant)
Expand Down

0 comments on commit 028d27d

Please sign in to comment.