Skip to content

Commit

Permalink
fix: Maybe fix watch. Fixes #2678
Browse files Browse the repository at this point in the history
  • Loading branch information
alexec committed Apr 16, 2020
1 parent db6d141 commit 9446416
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pkg/apiclient/watch-intermediary.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ type watchIntermediary struct {
events chan *workflowpkg.WorkflowWatchEvent
}

func (w watchIntermediary) Send(e *workflowpkg.WorkflowWatchEvent) error {
w.events <- e
return nil
}

func (w watchIntermediary) Recv() (*workflowpkg.WorkflowWatchEvent, error) {
select {
case e := <-w.error:
return nil, e
default:
return <-w.events, nil
case event := <-w.events:
return event, nil
}
}

func (w watchIntermediary) Send(e *workflowpkg.WorkflowWatchEvent) error {
w.events <- e
return nil
}

func newWatchIntermediary(ctx context.Context) *watchIntermediary {
return &watchIntermediary{newAbstractIntermediary(ctx), make(chan *workflowpkg.WorkflowWatchEvent)}
}

0 comments on commit 9446416

Please sign in to comment.