@@ -231,3 +231,21 @@ func (p *process) Wait(ctx context.Context) (*runtime.Exit, error) {
|
||||
Timestamp: ea,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (p *process) Delete(ctx context.Context) (*runtime.Exit, error) {
|
||||
ec, ea, err := p.ExitCode()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// If we never started the process close the pipes
|
||||
if p.Status() == runtime.CreatedStatus {
|
||||
p.io.Close()
|
||||
ea = time.Now()
|
||||
}
|
||||
p.task.removeProcess(p.id)
|
||||
return &runtime.Exit{
|
||||
Pid: p.pid,
|
||||
Status: ec,
|
||||
Timestamp: ea,
|
||||
}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user