Git Product home page Git Product logo

Comments (3)

vmihailenco avatar vmihailenco commented on July 26, 2024

That is expected. If Redis is down, cache will call the underlying function to get the result and discard the error from Redis.

from cache.

newly12 avatar newly12 commented on July 26, 2024

what's the suggestion for leverage Once or other function provided to figure out whether there is a problem communicating with Redis during cache get/set? apparently this doesn't work even when SkipLocalCache is explicitly set to false..

from cache.

ivanduka avatar ivanduka commented on July 26, 2024

If Redis is down, but we still have the ability to get the data from somewhere else, it makes sense to do it and fail gracefully. This delivers additional robustness to have this fail-proof mode. There will be an expensive call to populate the cache on every Once call, but at least the client will get something at the expense of the performance of having a functional Redis. It makes little sense to return only an error if there is a way to get the data from somewhere.

However, silently swallowing an error is making it hard to detect if Redis is down, especially if the system has only Once calls and does not have any other function calls that fail on Redis being down.

Is it possible to make Once return a specific error that can be unwrapped AND populating the data/payload to handle this failure and distinguish the Redis error from simply not having an item in cache?

from cache.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.