优化并发读写限制

This commit is contained in:
GoEdgeLab
2024-05-01 12:42:35 +08:00
parent 2b35971a66
commit c50a0de9eb
5 changed files with 59 additions and 8 deletions

View File

@@ -314,8 +314,9 @@ func (this *FileReader) ReadBodyRange(buf []byte, start int64, end int64, callba
}
for {
var n int
fsutils.ReaderLimiter.Ack()
n, err := this.fp.Read(buf)
n, err = this.fp.Read(buf)
fsutils.ReaderLimiter.Release()
if n > 0 {
var n2 = int(end-offset) + 1