Add Cmd.Wait() to prevent creation of zombie child processes see: #1

This commit is contained in:
Benson Wong
2024-10-04 21:38:29 -07:00
parent 4fae7cf946
commit 476086c066

View File

@@ -57,6 +57,9 @@ func (pm *ProxyManager) swapModel(requestedModel string) error {
// kill the current running one to swap it
if pm.currentCmd != nil {
pm.currentCmd.Process.Signal(syscall.SIGTERM)
// wait for it to end
pm.currentCmd.Process.Wait()
}
pm.currentConfig = modelConfig