Skip to content

Commit

Permalink
fix: 解决单位转换导致的内存限制问题 (1Panel-dev#4055)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssongliu authored Mar 4, 2024
1 parent e9cc7bf commit 9418153
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions backend/app/dto/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ type ContainerInfo struct {
}

type ResourceLimit struct {
CPU int `json:"cpu"`
Memory int `json:"memory"`
CPU int `json:"cpu"`
Memory uint64 `json:"memory"`
}

type ContainerOperate struct {
Expand Down
2 changes: 1 addition & 1 deletion backend/app/service/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ func (u *ContainerService) LoadResourceLimit() (*dto.ResourceLimit, error) {

data := dto.ResourceLimit{
CPU: cpuCounts,
Memory: int(memoryInfo.Total),
Memory: memoryInfo.Total,
}
return &data, nil
}
Expand Down

0 comments on commit 9418153

Please sign in to comment.