mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-11-05 21:02:11 +08:00
Optimize Docker configuration and script.
This commit is contained in:
parent
9765256288
commit
d1eff3f4ba
@ -7,14 +7,12 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
// 使用gopsutil获取虚拟内存信息
|
|
||||||
vMem, err := mem.VirtualMemory()
|
vMem, err := mem.VirtualMemory()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Failed to get virtual memory info: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Failed to get virtual memory info: %v\n", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 将可用内存从字节转换为GB
|
|
||||||
freeMemoryGB := float64(vMem.Free) / float64(1024*1024*1024)
|
freeMemoryGB := float64(vMem.Free) / float64(1024*1024*1024)
|
||||||
|
|
||||||
if freeMemoryGB < 4.0 {
|
if freeMemoryGB < 4.0 {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user