Skip to content

Commit

Permalink
Revert "Hide memory limit is reached error (#60)" (#61)
Browse files Browse the repository at this point in the history
This reverts commit cd67a69.
  • Loading branch information
evgeniy-scherbina authored Nov 6, 2023
1 parent cd67a69 commit d45ce1d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions service/cachemdw/caching_middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
}
}
Expand Down

0 comments on commit d45ce1d

Please sign in to comment.