mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-31 22:18:07 +08:00
fix: 解决应用内存限制回显失败的问题 (#1237)
This commit is contained in:
parent
3773d64aa7
commit
957499e4d7
@ -900,7 +900,7 @@ func getAppCommonConfig(envs map[string]interface{}) request.AppContainerConfig
|
|||||||
config.CpuQuota = 0
|
config.CpuQuota = 0
|
||||||
}
|
}
|
||||||
if memLimit, ok := envs[constant.MemoryLimit]; ok {
|
if memLimit, ok := envs[constant.MemoryLimit]; ok {
|
||||||
re := regexp.MustCompile(`(\d+(?:\.\d+)?)\s*([KMGT]?B)`)
|
re := regexp.MustCompile(`(\d+)([A-Za-z]+)`)
|
||||||
matches := re.FindStringSubmatch(memLimit.(string))
|
matches := re.FindStringSubmatch(memLimit.(string))
|
||||||
if len(matches) == 3 {
|
if len(matches) == 3 {
|
||||||
num, err := strconv.ParseFloat(matches[1], 64)
|
num, err := strconv.ParseFloat(matches[1], 64)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user