More efficiently reap zombeis in spawn.go
This commit is contained in:
@@ -61,7 +61,11 @@ func (c *MyConfig) CleanZombies() {
|
|||||||
r := syscall.Rusage{}
|
r := syscall.Rusage{}
|
||||||
|
|
||||||
for {
|
for {
|
||||||
_, _ = syscall.Wait4(-1, nil, syscall.WNOHANG, &r)
|
pid, _ := syscall.Wait4(-1, nil, syscall.WNOHANG, &r)
|
||||||
|
|
||||||
|
if pid > 0 {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
time.Sleep(1 * time.Minute)
|
time.Sleep(1 * time.Minute)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user