diff --git a/.golangci.yaml b/.golangci.yaml index 36908ff..8011bb4 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -72,4 +72,5 @@ linters: - whitespace - noctx - rowserrcheck - - tagliatelle \ No newline at end of file + - tagliatelle + - protogetter \ No newline at end of file diff --git a/internal/caches/storage_memory.go b/internal/caches/storage_memory.go index beee962..9dce30a 100644 --- a/internal/caches/storage_memory.go +++ b/internal/caches/storage_memory.go @@ -560,6 +560,11 @@ func (this *MemoryStorage) flushItem(fullKey string) { if !isInList { for i := 0; i < 1000; i++ { isInList, _, err = this.list.Exist(types.String(hash)) + if err != nil { + remotelogs.Error("CACHE", "flush items failed: "+err.Error()) + time.Sleep(1 * time.Second) + continue + } if isInList { break } diff --git a/internal/utils/fnv/hash_test.go b/internal/utils/fnv/hash_test.go index a311c09..b889f0f 100644 --- a/internal/utils/fnv/hash_test.go +++ b/internal/utils/fnv/hash_test.go @@ -18,7 +18,7 @@ func TestHash(t *testing.T) { func BenchmarkHashString(b *testing.B) { b.RunParallel(func(pb *testing.PB) { for pb.Next() { - fnv.HashString("abcdefh") + _ = fnv.HashString("abcdefh") } }) -} \ No newline at end of file +} diff --git a/internal/waf/requests/request.go b/internal/waf/requests/request.go index 6c4e53b..4bd57ea 100644 --- a/internal/waf/requests/request.go +++ b/internal/waf/requests/request.go @@ -39,7 +39,7 @@ type Request interface { WAFMaxRequestSize() int64 // Format 格式化变量 - Format(string) string + Format(varString string) string // ProcessResponseHeaders 处理响应Header ProcessResponseHeaders(headers http.Header, status int)