commit
25c403415a
5
task.go
5
task.go
@ -283,7 +283,6 @@ func (t *task) Delete(ctx context.Context, opts ...ProcessDeleteOpts) (*ExitStat
|
|||||||
if t.io != nil {
|
if t.io != nil {
|
||||||
t.io.Cancel()
|
t.io.Cancel()
|
||||||
t.io.Wait()
|
t.io.Wait()
|
||||||
t.io.Close()
|
|
||||||
}
|
}
|
||||||
r, err := t.client.TaskService().Delete(ctx, &tasks.DeleteTaskRequest{
|
r, err := t.client.TaskService().Delete(ctx, &tasks.DeleteTaskRequest{
|
||||||
ContainerID: t.id,
|
ContainerID: t.id,
|
||||||
@ -291,6 +290,10 @@ func (t *task) Delete(ctx context.Context, opts ...ProcessDeleteOpts) (*ExitStat
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errdefs.FromGRPC(err)
|
return nil, errdefs.FromGRPC(err)
|
||||||
}
|
}
|
||||||
|
// Only cleanup the IO after a successful Delete
|
||||||
|
if t.io != nil {
|
||||||
|
t.io.Close()
|
||||||
|
}
|
||||||
return &ExitStatus{code: r.ExitStatus, exitedAt: r.ExitedAt}, nil
|
return &ExitStatus{code: r.ExitStatus, exitedAt: r.ExitedAt}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user