From 5890f7a98dbbecec3c658965f8db68f4c60e600f Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Tue, 30 Apr 2024 20:26:34 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BB=E5=8F=96=E7=BC=93=E5=AD=98=E6=97=B6?= =?UTF-8?q?=E6=80=BB=E6=98=AF=E5=B0=9D=E8=AF=95=E6=89=93=E5=BC=80=E6=96=87?= =?UTF-8?q?=E4=BB=B6=EF=BC=8C=E4=B8=8D=E5=8F=97=E5=B9=B6=E5=8F=91=E8=AF=BB?= =?UTF-8?q?=E7=9A=84=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/caches/storage_file.go | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/internal/caches/storage_file.go b/internal/caches/storage_file.go index 2cafca1..7fbc707 100644 --- a/internal/caches/storage_file.go +++ b/internal/caches/storage_file.go @@ -393,11 +393,7 @@ func (this *FileStorage) openReader(key string, allowMemory bool, useStale bool, // 尝试通过MMAP读取 if estimatedSize > 0 { - if !fsutils.ReaderLimiter.TryAck() { - return nil, ErrServerIsBusy - } reader, err := this.tryMMAPReader(isPartial, estimatedSize, path) - fsutils.ReaderLimiter.Release() if err != nil { return nil, err } @@ -416,11 +412,7 @@ func (this *FileStorage) openReader(key string, allowMemory bool, useStale bool, var err error if openFile == nil { - if !fsutils.ReaderLimiter.TryAck() { - return nil, ErrServerIsBusy - } fp, err = os.OpenFile(path, os.O_RDONLY, 0444) - fsutils.ReaderLimiter.Release() if err != nil { if !os.IsNotExist(err) { return nil, err @@ -591,11 +583,7 @@ func (this *FileStorage) openWriter(key string, expiredAt int64, status int, hea // 数据库中是否存在 existsCacheItem, _, _ := this.list.Exist(hash) if existsCacheItem { - if !fsutils.ReaderLimiter.TryAck() { - return nil, ErrServerIsBusy - } readerFp, err := os.OpenFile(tmpPath, os.O_RDONLY, 0444) - fsutils.ReaderLimiter.Release() if err == nil { var partialReader = NewPartialFileReader(readerFp) err = partialReader.Init()