Merge pull request #1643 from cpuguy83/close_wait_chan
Close wait chan after sending status
This commit is contained in:
commit
2cdb3951a4
@ -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,
|
||||
|
1
task.go
1
task.go
@ -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,
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user