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
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:
@@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user