Browse Source

detect non streaming mode on the first read

pull/2532/head
chrislu 3 years ago
parent
commit
0ec7bc6710
  1. 7
      weed/filer/reader_pattern.go

7
weed/filer/reader_pattern.go

@ -11,7 +11,7 @@ type ReaderPattern struct {
func NewReaderPattern() *ReaderPattern {
return &ReaderPattern{
isStreaming: true,
lastReadOffset: 0,
lastReadOffset: -1,
}
}
@ -19,6 +19,11 @@ func (rp *ReaderPattern) MonitorReadAt(offset int64, size int) {
if rp.lastReadOffset > offset {
rp.isStreaming = false
}
if rp.lastReadOffset == -1 {
if offset != 0 {
rp.isStreaming = false
}
}
rp.lastReadOffset = offset
}

Loading…
Cancel
Save