Comments (3)
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.
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.
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)
- LRU cache
- newbie: trying to understand utility of this package compared to `redis/go-redis/v9`
- Crashed if tiny lfu size is 1 or 2
- Using TinyLFU doesn't work as you would expect a cache to HOT 1
- How to use cache like map[string]any?
- Why do I think the higher the version, the more difficult it is to use? HOT 1
- Feature request: Support TTL command HOT 4
- TTL in TinyLFU vs TTL in cache.Item HOT 1
- How to save the array HOT 1
- Nil comparaison used for Item.Value field is not accurate HOT 1
- Add batch delete feature HOT 1
- unknown compression method: 3d HOT 6
- Add instructions to use context.WithCancel() to documentation HOT 1
- Is it safe to use it with concurrency? HOT 4
- Is there any way to flushdb with go redis cache? HOT 2
- Dates are unmarshaled to time.Local HOT 1
- How to set item with no expiration? HOT 4
- Cache with mock doesn't work HOT 1
- go-redis V9 compatibility HOT 2
- add support redis/rueidis
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cache.