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

Non expiring Redis keys in Rails 5.2 #349

Closed
morgoth opened this issue Jun 19, 2018 · 5 comments
Closed

Non expiring Redis keys in Rails 5.2 #349

morgoth opened this issue Jun 19, 2018 · 5 comments

Comments

@morgoth
Copy link

morgoth commented Jun 19, 2018

When using Rails 5.2 and built in Redis cache store https://github.com/rails/rails/blob/master/activesupport/lib/active_support/cache/redis_cache_store.rb
keys sets in Redis are not expiring.

This most likely is becuase:

It's a serious issue as the Redis db grows quickly on the big traffic.

Workaround found so far: Rack::Attack.cache.store = Redis.current, but only with #348

It may also be resolved by closed #340 - but I didn't check it

@grzuy
Copy link
Collaborator

grzuy commented Jun 19, 2018

Hi @morgoth, thank you very much for reporting this issue.

I can reproduce the problem on my side also.

@grzuy
Copy link
Collaborator

grzuy commented Jun 19, 2018

5.3.0 released

@morgoth
Copy link
Author

morgoth commented Jun 19, 2018

Thank you

@grzuy
Copy link
Collaborator

grzuy commented Jul 2, 2018

Rails.cache responds to increment, but it ignores expires_in option, thus it results in non expiring keys

For whoever is interested, Rails has changed this in master a couple of days ago. See Add :expires_in option support for RedisCacheStore increment/decrement method. I don't think it's released yet though.

@grzuy
Copy link
Collaborator

grzuy commented Oct 23, 2019

Rails.cache responds to increment, but it ignores expires_in option, thus it results in non expiring keys

For whoever is interested, Rails has changed this in master a couple of days ago. See Add :expires_in option support for RedisCacheStore increment/decrement method. I don't think it's released yet though.

It was released in activesupport v6.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants