mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
add IGNORE_MEMORY
This commit is contained in:
@@ -196,6 +196,10 @@ func dynamicSizing(reqMem uint64) int {
|
||||
reqMem = 128
|
||||
}
|
||||
|
||||
var availableMemory uint64
|
||||
if os.Getenv("IGNORE_MEMORY") == "1" {
|
||||
availableMemory = tooBig
|
||||
} else {
|
||||
availableMemory, err := checkCgroup()
|
||||
if err != nil {
|
||||
logrus.WithError(err).Error("Error checking for cgroup memory limits, falling back to host memory available..")
|
||||
@@ -207,6 +211,7 @@ func dynamicSizing(reqMem uint64) int {
|
||||
logrus.WithError(err).Fatal("Your Linux version is too old (<3.14) then we can't get the proper information to . You must specify the maximum available memory by passing the -m command with docker run when starting the runner via docker, eg: `docker run -m 2G ...`")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
c := availableMemory / (reqMem * 1024 * 1024)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user