fix(go): int64 -> uint64 for connection limit value

This commit is contained in:
Gabe Kangas
2024-09-17 08:11:35 -07:00
parent 6cf93b98e1
commit 7a65e6d808
3 changed files with 6 additions and 6 deletions

View File

@@ -9,14 +9,14 @@ import (
log "github.com/sirupsen/logrus"
)
func getMaximumConcurrentConnectionLimit() int64 {
func getMaximumConcurrentConnectionLimit() uint64 {
var rLimit syscall.Rlimit
if err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &rLimit); err != nil {
log.Fatalln(err)
}
// Return the limit to 70% of max so the machine doesn't die even if it's maxed out for some reason.
proposedLimit := int64(float32(rLimit.Max) * 0.7)
proposedLimit := uint64(float32(rLimit.Max) * 0.7)
return proposedLimit
}