Quantcast
Channel: Active questions tagged redis+ruby-on-rails - Stack Overflow
Viewing all articles
Browse latest Browse all 873

Rails.cache fails after being idle for some minutes

$
0
0

Last week we migrated our app to Ruby 3.2.2 and Rails 7.0.4.3. Since then, we've started getting errors when executing any commands that need to access Redis. This issue only occurs in production. The app is on Heroku, and it's running the latest version of Redis available, 7.0.11.

It seems like Rails is losing connection with Redis, it fails on the first try, but if you try again, it passes.

Example

However, if you run it again after a few minutes (5 maybe?) without running anything, it'll fail again and then pass on the next try.

Does anyone have an idea on how to solve it?

I tried to use rescue on the places where we are reading/writing to the cache, but it's not working.


Viewing all articles
Browse latest Browse all 873

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>