From f23015ac5ba04f3b5b9f2efbadf4919f76066e79 Mon Sep 17 00:00:00 2001 From: chrislu Date: Tue, 10 Sep 2024 10:30:05 -0700 Subject: [PATCH] weed mount caching --- weed/filer/reader_cache.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/weed/filer/reader_cache.go b/weed/filer/reader_cache.go index fea2bbc89..a3df8e0bd 100644 --- a/weed/filer/reader_cache.go +++ b/weed/filer/reader_cache.go @@ -7,9 +7,9 @@ import ( "time" "github.com/seaweedfs/seaweedfs/weed/util/chunk_cache" + util_http "github.com/seaweedfs/seaweedfs/weed/util/http" "github.com/seaweedfs/seaweedfs/weed/util/mem" "github.com/seaweedfs/seaweedfs/weed/wdclient" - util_http "github.com/seaweedfs/seaweedfs/weed/util/http" ) type ReaderCache struct { @@ -69,7 +69,7 @@ func (rc *ReaderCache) MaybeCache(chunkViews *Interval[*ChunkView]) { // glog.V(4).Infof("prefetch %s offset %d", chunkView.FileId, chunkView.ViewOffset) // cache this chunk if not yet - cacher := newSingleChunkCacher(rc, chunkView.FileId, chunkView.CipherKey, chunkView.IsGzipped, int(chunkView.ChunkSize), false) + cacher := newSingleChunkCacher(rc, chunkView.FileId, chunkView.CipherKey, chunkView.IsGzipped, int(chunkView.ChunkSize), chunkView.ViewOffset == 0) go cacher.startCaching() <-cacher.cacheStartedCh rc.downloaders[chunkView.FileId] = cacher