add graceful process termination on windows (#82)
This commit is contained in:
committed by
GitHub
parent
84e2c07a7e
commit
4c3aa40564
14
proxy/process_stop_windows.go
Normal file
14
proxy/process_stop_windows.go
Normal file
@@ -0,0 +1,14 @@
|
||||
//go:build windows
|
||||
|
||||
package proxy
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os/exec"
|
||||
)
|
||||
|
||||
func (p *Process) terminateProcess() error {
|
||||
pid := fmt.Sprintf("%d", p.cmd.Process.Pid)
|
||||
cmd := exec.Command("taskkill", "/f", "/t", "/pid", pid)
|
||||
return cmd.Run()
|
||||
}
|
||||
Reference in New Issue
Block a user