优化代码

This commit is contained in:
刘祥超
2024-03-28 17:17:34 +08:00
parent f119690ab7
commit f1d0984031
27 changed files with 52 additions and 63 deletions
+2 -2
View File
@@ -5,8 +5,8 @@ package caches
import (
"fmt"
"github.com/TeaOSLab/EdgeNode/internal/goman"
"github.com/TeaOSLab/EdgeNode/internal/utils"
"github.com/TeaOSLab/EdgeNode/internal/utils/linkedlist"
memutils "github.com/TeaOSLab/EdgeNode/internal/utils/mem"
"github.com/fsnotify/fsnotify"
"github.com/iwind/TeaGo/logs"
"github.com/iwind/TeaGo/types"
@@ -43,7 +43,7 @@ func NewOpenFileCache(maxCount int) (*OpenFileCache, error) {
maxCount: maxCount,
poolMap: map[string]*OpenFilePool{},
poolList: linkedlist.NewList[*OpenFilePool](),
capacitySize: (int64(utils.SystemMemoryGB()) << 30) / 16,
capacitySize: (int64(memutils.SystemMemoryGB()) << 30) / 16,
}
watcher, err := fsnotify.NewWatcher()