优化MMAP相关功能

This commit is contained in:
GoEdgeLab
2024-04-04 08:28:14 +08:00
parent 4c30c28b4c
commit dcd8a0e020
12 changed files with 65 additions and 61 deletions

View File

@@ -140,7 +140,7 @@ func TestFileList_Exist(t *testing.T) {
}()
{
var hash = stringutil.Md5("123456")
exists, err := list.Exist(hash)
exists, _, err := list.Exist(hash)
if err != nil {
t.Fatal(err)
}
@@ -148,7 +148,7 @@ func TestFileList_Exist(t *testing.T) {
}
{
var hash = stringutil.Md5("http://edge.teaos.cn/1234561")
exists, err := list.Exist(hash)
exists, _, err := list.Exist(hash)
if err != nil {
t.Fatal(err)
}
@@ -208,7 +208,7 @@ func TestFileList_Exist_Many_DB(t *testing.T) {
countLocker.Unlock()
var list = listSlice[rands.Int(0, len(listSlice)-1)]
_, _ = list.Exist(hash)
_, _, _ = list.Exist(hash)
default:
return
}
@@ -442,6 +442,6 @@ func BenchmarkFileList_Exist(b *testing.B) {
}
b.ResetTimer()
for i := 0; i < b.N; i++ {
_, _ = list.Exist("f0eb5b87e0b0041f3917002c0707475f" + types.String(i))
_, _, _ = list.Exist("f0eb5b87e0b0041f3917002c0707475f" + types.String(i))
}
}