Skip to content

Commit

Permalink
should be cancelled here (#390)
Browse files Browse the repository at this point in the history
  • Loading branch information
tonicmuroq authored and CMGS committed Apr 16, 2021
1 parent 1f93621 commit 598dcf6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rpc/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,6 @@ func (v *Vibranium) RunAndWait(stream pb.CoreRPC_RunAndWaitServer) error {
// force mark stdin to false
opts.OpenStdin = false
}
defer cancel()

v.taskAdd("RunAndWait", true)

Expand All @@ -848,6 +847,7 @@ func (v *Vibranium) RunAndWait(stream pb.CoreRPC_RunAndWaitServer) error {

ids, ch, err := v.cluster.RunAndWait(ctx, deployOpts, inCh)
if err != nil {
cancel()
return grpcstatus.Error(RunAndWait, err.Error())
}

Expand All @@ -865,6 +865,7 @@ func (v *Vibranium) RunAndWait(stream pb.CoreRPC_RunAndWaitServer) error {
// then deal with the rest messages
runAndWait := func(f func(<-chan *types.AttachWorkloadMessage)) {
defer v.taskDone("RunAndWait", true)
defer cancel()
f(ch)
}

Expand Down

0 comments on commit 598dcf6

Please sign in to comment.