From 822e967874442bf7edcc118db89e1386b6914dc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Tue, 17 Oct 2023 09:59:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=96=87=E4=BB=B6=E5=8F=A5?= =?UTF-8?q?=E6=9F=84=E7=BC=93=E5=AD=98=E5=AE=B9=E9=87=8F=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/caches/open_file_cache.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/caches/open_file_cache.go b/internal/caches/open_file_cache.go index c814964..3b0be13 100644 --- a/internal/caches/open_file_cache.go +++ b/internal/caches/open_file_cache.go @@ -93,7 +93,7 @@ func (this *OpenFileCache) Put(filename string, file *OpenFile) { defer this.locker.Unlock() // 如果超过当前容量,则关闭最早的 - if this.count >= this.maxCount || this.usedSize >= this.capacitySize { + if this.count >= this.maxCount || this.usedSize+file.size >= this.capacitySize { this.consumeHead() return }