diff options
Diffstat (limited to 'vendor/github.com/KimMachineGun/automemlimit/memlimit/provider.go')
-rw-r--r-- | vendor/github.com/KimMachineGun/automemlimit/memlimit/provider.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/vendor/github.com/KimMachineGun/automemlimit/memlimit/provider.go b/vendor/github.com/KimMachineGun/automemlimit/memlimit/provider.go index 32cc1eea6..4f83770d1 100644 --- a/vendor/github.com/KimMachineGun/automemlimit/memlimit/provider.go +++ b/vendor/github.com/KimMachineGun/automemlimit/memlimit/provider.go @@ -16,6 +16,9 @@ func Limit(limit uint64) func() (uint64, error) { // ApplyRationA is a helper Provider function that applies the given ratio to the given provider. func ApplyRatio(provider Provider, ratio float64) Provider { + if ratio == 1 { + return provider + } return func() (uint64, error) { if ratio <= 0 || ratio > 1 { return 0, fmt.Errorf("invalid ratio: %f, ratio should be in the range (0.0,1.0]", ratio) |