mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
detect non streaming mode on the first read
This commit is contained in:
parent
4c1368d621
commit
0ec7bc6710
|
@ -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…
Reference in a new issue