fix(auth): close cancellation and workspace races
This commit is contained in:
@@ -15,6 +15,25 @@ func configureProcess(command *exec.Cmd) {
|
||||
command.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
|
||||
}
|
||||
|
||||
type unixProcessLifetime struct {
|
||||
command *exec.Cmd
|
||||
}
|
||||
|
||||
func startProcess(command *exec.Cmd) (processLifetime, error) {
|
||||
if err := command.Start(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return unixProcessLifetime{command: command}, nil
|
||||
}
|
||||
|
||||
func (process unixProcessLifetime) terminate(done <-chan error) error {
|
||||
return terminateProcess(process.command, done)
|
||||
}
|
||||
|
||||
func (unixProcessLifetime) close() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func terminateProcess(command *exec.Cmd, done <-chan error) error {
|
||||
if command.Process == nil {
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user