Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add :expires_in option support for RedisCacheStore increment/decrement method#33254

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@huacnlee
Copy link
Contributor

@huacnleehuacnlee commentedJun 29, 2018
edited
Loading

Redis not supportincry with expire option, so callexpire.

This fix is keep same behavior with the:memcached store.

irb>Rails.cache.increment("my_counter",1,expires_in:100)1irb>Rails.cache.data.ttl("my_counter")=>99# skip set expire when "my_counter" has ttlirb>Rails.cache.increment("my_counter",1,expires_in:200)2irb>Rails.cache.data.ttl("my_counter")=>98

vimutter, fanjieqi, and ezekg reacted with thumbs up emoji
@rails-bot
Copy link

Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from@kamipo (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

This repository is being automatically checked for code quality issues usingCode Climate. You can see results for this analysis in the PR status below. Newly introduced issues should be fixed before a Pull Request is considered ready to review.

Please seethe contribution instructions for more information.

@huacnleehuacnleeforce-pushed theadd-expires-in-option-support-for-redis-cache-store-increment-method branch from72cb3c9 to9d5b02eCompareJune 29, 2018 07:53
@rafaelfrancarafaelfranca merged commit4883f73 intorails:masterJun 29, 2018
@huacnleehuacnlee deleted the add-expires-in-option-support-for-redis-cache-store-increment-method branchJune 29, 2018 09:12
kaspth added a commit that referenced this pull requestJul 1, 2018
Firstly, increment and decrement shouldn't care about the particulars ofkey expiry. They should only know that they have to pass that responsibilityon to somewhere else.Secondly, it moves the key normalization back inside the instrumentation likeit was originally. I think that matches the original design intention or atthe very least it lets users catch haywire key truncation.Thirdly, it moves the changelog entry to the top of the file, where new entriesgo. I couldn't understand what the entry was saying so I tried to rewrite it.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

@kamipokamipo

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@huacnlee@rails-bot@kamipo@rafaelfranca

[8]ページ先頭

©2009-2025 Movatter.jp