From d45ce1d4ee0c2c936eb44dbf62371499ca39b2e7 Mon Sep 17 00:00:00 2001 From: Evgeniy Scherbina Date: Mon, 6 Nov 2023 15:15:26 -0500 Subject: [PATCH] Revert "Hide memory limit is reached error (#60)" (#61) This reverts commit cd67a69b5e95da575d249b8e90ae04f1cb798667. --- service/cachemdw/caching_middleware.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/service/cachemdw/caching_middleware.go b/service/cachemdw/caching_middleware.go index 05f4438..1f36ede 100644 --- a/service/cachemdw/caching_middleware.go +++ b/service/cachemdw/caching_middleware.go @@ -4,7 +4,6 @@ import ( "bytes" "io" "net/http" - "strings" "github.com/kava-labs/kava-proxy-service/decode" "github.com/kava-labs/kava-proxy-service/logging" @@ -53,13 +52,12 @@ func (c *ServiceCache) CachingMiddleware( // if request isn't already cached, request is cacheable and response is present in context - cache the response if !isCached && cacheable && ok { headersToCache := getHeadersToCache(w, c.whitelistedHeaders) - memoryLimitIsReachedError := "OOM command not allowed when used memory > 'maxmemory'" if err := c.CacheQueryResponse( r.Context(), decodedReq, typedResponse, headersToCache, - ); err != nil && !strings.Contains(err.Error(), memoryLimitIsReachedError) { + ); err != nil { c.Logger.Error().Msgf("can't validate and cache response: %v", err) } }