mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-12-27 15:46:34 +08:00
文件缓存自动加载热门数据时检查是否有足够的内存空间
This commit is contained in:
@@ -1156,11 +1156,16 @@ func (this *FileStorage) purgeLoop() {
|
||||
|
||||
// 热点数据任务
|
||||
func (this *FileStorage) hotLoop() {
|
||||
var memoryStorage = this.memoryStorage
|
||||
var memoryStorage = this.memoryStorage // copy
|
||||
if memoryStorage == nil {
|
||||
return
|
||||
}
|
||||
|
||||
// check memory space size
|
||||
if !memoryStorage.HasFreeSpaceForHotItems() {
|
||||
return
|
||||
}
|
||||
|
||||
this.hotMapLocker.Lock()
|
||||
if len(this.hotMap) == 0 {
|
||||
this.hotMapLocker.Unlock()
|
||||
|
||||
Reference in New Issue
Block a user