mirror of
https://github.com/datarhei/core.git
synced 2025-10-21 15:09:36 +08:00
Fix MaxCPU and MaxMemory semantics
If a limit of 0 (or negative) is given for both cpu and memory, then no limiting will be triggered. If any value between 1 and 100 (inclusive) is given, then limiting will be triggered when that limit is reached. I.e. giving a limit of 100 doesn't not mean unlimited.
This commit is contained in:
@@ -177,6 +177,16 @@ func TestHasLimits(t *testing.T) {
|
||||
|
||||
require.True(t, r.HasLimits())
|
||||
|
||||
r, err = New(Config{
|
||||
MaxCPU: 100,
|
||||
MaxMemory: 100,
|
||||
PSUtil: &util{},
|
||||
Logger: nil,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
require.True(t, r.HasLimits())
|
||||
|
||||
r, err = New(Config{
|
||||
MaxCPU: 0,
|
||||
MaxMemory: 0,
|
||||
|
Reference in New Issue
Block a user