From 86596461a1375fb05a212275c3d62e1ab829579d Mon Sep 17 00:00:00 2001 From: eleksir Date: Tue, 31 Mar 2026 01:23:02 +0300 Subject: [PATCH] More efficiently reap zombeis in spawn.go --- internal/lib/spawn.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/lib/spawn.go b/internal/lib/spawn.go index 427c060..a84cf5e 100644 --- a/internal/lib/spawn.go +++ b/internal/lib/spawn.go @@ -61,7 +61,11 @@ func (c *MyConfig) CleanZombies() { r := syscall.Rusage{} 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) }