Skip to content

Commit

Permalink
Merge pull request #1643 from cpuguy83/close_wait_chan
Browse files Browse the repository at this point in the history
Close wait chan after sending status
  • Loading branch information
crosbymichael committed Oct 16, 2017
2 parents ef5fe56 + 2056254 commit 2cdb395
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions process.go
Expand Up @@ -120,6 +120,7 @@ func (p *process) Kill(ctx context.Context, s syscall.Signal, opts ...KillOpts)
func (p *process) Wait(ctx context.Context) (<-chan ExitStatus, error) {
c := make(chan ExitStatus, 1)
go func() {
defer close(c)
r, err := p.task.client.TaskService().Wait(ctx, &tasks.WaitRequest{
ContainerID: p.task.id,
ExecID: p.id,
Expand Down
1 change: 1 addition & 0 deletions task.go
Expand Up @@ -215,6 +215,7 @@ func (t *task) Status(ctx context.Context) (Status, error) {
func (t *task) Wait(ctx context.Context) (<-chan ExitStatus, error) {
c := make(chan ExitStatus, 1)
go func() {
defer close(c)
r, err := t.client.TaskService().Wait(ctx, &tasks.WaitRequest{
ContainerID: t.id,
})
Expand Down

0 comments on commit 2cdb395

Please sign in to comment.