fix swap linux cgroups
Some checks failed
memory-limit / Build judge (push) Successful in 13s
memory-limit / Linux / gcc (push) Successful in 9s
memory-limit / Linux / clang (push) Successful in 10s
memory-limit / Windows / clang (push) Failing after 11s
memory-limit / Windows / msvc (push) Failing after 13s

This commit is contained in:
2026-04-10 23:52:09 +03:00
parent a8adbfbae1
commit 319ac8f73d

View File

@@ -175,6 +175,10 @@ func (l *linuxLimiter) prepare(cmd *exec.Cmd) error {
l.cgPath = "" l.cgPath = ""
return fmt.Errorf("write memory.max: %w", err) return fmt.Errorf("write memory.max: %w", err)
} }
swapMax := filepath.Join(l.cgPath, "memory.swap.max")
if _, err := os.Stat(swapMax); err == nil {
_ = os.WriteFile(swapMax, []byte("0"), 0644)
}
return nil return nil
} }