Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache error fallback (ters) #643

Closed
slukes opened this issue Mar 1, 2024 · 4 comments
Closed

Cache error fallback (ters) #643

slukes opened this issue Mar 1, 2024 · 4 comments
Labels

Comments

@slukes
Copy link
Contributor

slukes commented Mar 1, 2024

Describe the bug

Following #588 and #51

It still appears to be the case that if redis is down, we get an error rather than the wrapped function being called.

Could we get some feedback on this please?

Would be happy to invest 1/2 a day to a day to help if you could give any guidance on how you imagined fixing this.

Thanks!

@slukes slukes added the bug label Mar 1, 2024
@jaredwray
Copy link
Owner

@slukes - thanks for reporting this. It looks like there has been little effort around this on handling it. I think that for right now we dont plan to fix this but if you want to come up with a solution we would love to look at it. Are you thinking that this would be an event that is fired when redis is down?

Going to close this out and if you want to create an enhancement go ahead and do a pull request.

@slukes
Copy link
Contributor Author

slukes commented Mar 2, 2024

Hello @jaredwray what I was imagining would be to:

  • add config argument of ignoreCacheErrors either to the method wrap or to caching
  • in the method wrap, surround both set and get methods in a try catch
  • in the catch, emit an event and just call the wrapped function

WDYT?

@jaredwray
Copy link
Owner

@slukes - would we want to just do the try...catch and do an event emit with error on it to keep it non invasive and simple?

@slukes
Copy link
Contributor Author

slukes commented Mar 3, 2024

Let's move this discussion to a PR 😄

@slukes slukes mentioned this issue Mar 3, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants