From ebd6097e6f7c60599e198e5444cdcb353b6328b7 Mon Sep 17 00:00:00 2001 From: chrislu Date: Tue, 7 Jun 2022 22:33:35 -0700 Subject: [PATCH] fix: sequence read rate is slow when use filer.ChunkReadAt.ReadAt #3074 related to https://github.com/chrislusf/seaweedfs/pull/3074 --- weed/filer/reader_pattern.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/weed/filer/reader_pattern.go b/weed/filer/reader_pattern.go index 5e6ea7348..b860bc577 100644 --- a/weed/filer/reader_pattern.go +++ b/weed/filer/reader_pattern.go @@ -16,15 +16,17 @@ func NewReaderPattern() *ReaderPattern { } func (rp *ReaderPattern) MonitorReadAt(offset int64, size int) { + isStreaming := true if rp.lastReadOffset > offset { - rp.isStreaming = false + isStreaming = false } if rp.lastReadOffset == -1 { if offset != 0 { - rp.isStreaming = false + isStreaming = false } } rp.lastReadOffset = offset + rp.isStreaming = isStreaming } func (rp *ReaderPattern) IsStreamingMode() bool {