feat(stream): fast buffer freeing for large cache (#1053)

Signed-off-by: j2rong4cn <36783515+j2rong4cn@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
j2rong4cn
2025-08-16 17:19:52 +08:00
committed by GitHub
parent d76407b201
commit 016ed90efa
8 changed files with 209 additions and 80 deletions

View File

@ -7,11 +7,13 @@ import (
"io"
"testing"
"github.com/OpenListTeam/OpenList/v4/internal/conf"
"github.com/OpenListTeam/OpenList/v4/internal/model"
"github.com/OpenListTeam/OpenList/v4/pkg/http_range"
)
func TestFileStream_RangeRead(t *testing.T) {
conf.MaxBufferLimit = 16 * 1024 * 1024
type args struct {
httpRange http_range.Range
}
@ -71,7 +73,7 @@ func TestFileStream_RangeRead(t *testing.T) {
}
})
}
t.Run("after check", func(t *testing.T) {
t.Run("after", func(t *testing.T) {
if f.GetFile() == nil {
t.Error("not cached")
}