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

Support skip nil for cache fetch #25437

Merged
merged 5 commits into from Aug 5, 2018

Conversation

@Martin91
Copy link
Contributor

@Martin91 Martin91 commented Jun 19, 2016

Summary

Provide a skip_nil setting for cache store. According to our cases, we need to cache some results retrieved from external services with 1 day expiration time, but if they are down with some accidental reasons, nil result will be cached whole day, instead, we hope not to cache that result, so we can always retry retrieving and it can cache expected result again once the services come back normal.

I have added one more spec for this setting and it ensures not to break existed behaviours, I also updated the documentation for #fetch method.

@rails-bot
Copy link

@rails-bot rails-bot commented Jun 19, 2016

Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @sgrif (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.

Please see the contribution instructions for more information.

@Martin91
Copy link
Contributor Author

@Martin91 Martin91 commented Jun 19, 2016

@sgrif @maclover7 I saw some build failures in ci but I think they are not related to my PR, should I pay attention to or am responsible for them?
image

@maclover7
Copy link
Member

@maclover7 maclover7 commented Jun 19, 2016

@Martin91 nope, master is failing right now. will be green again once #25436 is merged in.

@Martin91
Copy link
Contributor Author

@Martin91 Martin91 commented Jun 21, 2016

Ok, glad to sound that
Jon Moss notifications@github.com于2016年6月20日 周一上午4:47写道:

@Martin91 https://github.com/Martin91 nope, master is failing right
now. will be green again once #25436
#25436 is merged in.


You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
#25437 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/ACxCpKLXM2gFzZjwftWLAEcHVl6VWvGIks5qNar6gaJpZM4I5GPQ
.

@Martin91
Copy link
Contributor Author

@Martin91 Martin91 commented Mar 16, 2017

I wonder if anyone has any opinion on this PR?

@schneems
Copy link
Member

@schneems schneems commented Jul 22, 2018

This seems fine. Can you fix the conflicts?

@Martin91
Copy link
Contributor Author

@Martin91 Martin91 commented Jul 23, 2018

@schneems Sure.

@Martin91 Martin91 force-pushed the Martin91:support-skip-nil-for-cache-fetch branch 3 times, most recently Jul 23, 2018
@Martin91
Copy link
Contributor Author

@Martin91 Martin91 commented Jul 23, 2018

@schneems I have rebased the branch and resolved the conflicts.

@schneems
Copy link
Member

@schneems schneems commented Jul 23, 2018

Tests are failing, can you take a look. Also I’ll need a change log entry for this.

We are getting close, thanks for your work here!

@Martin91 Martin91 force-pushed the Martin91:support-skip-nil-for-cache-fetch branch to 4bb7e63 Aug 5, 2018
@Martin91
Copy link
Contributor Author

@Martin91 Martin91 commented Aug 5, 2018

@schneems I have added a change log entry and it seems that all tests have passed.

@schneems
Copy link
Member

@schneems schneems commented Aug 5, 2018

Thanks!

@schneems schneems merged commit 47018a8 into rails:master Aug 5, 2018
2 checks passed
2 checks passed
codeclimate All good!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@rlue
Copy link
Contributor

@rlue rlue commented Oct 20, 2019

This feature was announced here as a feature of Rails 5.2.1, but it appears to be absent from the 5-2-stable branch—have I missed something? If not, is there any chance we could get it backported?

@rlue rlue unassigned sgrif Oct 20, 2019
@kamilpp
Copy link

@kamilpp kamilpp commented Feb 3, 2020

I confirm that skip_nil option is not present in Rails 5.2, despite it was announced so

@rafaelfranca
Copy link
Member

@rafaelfranca rafaelfranca commented Feb 24, 2020

It was not announced as part of 5.2. It was announced in the same email saying that 5.2.1 was released but nothing there say it is part of 5.2. Am I missing something?

@rlue
Copy link
Contributor

@rlue rlue commented Feb 25, 2020

Ah, so that's how it works! My mistake.

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

Successfully merging this pull request may close these issues.

None yet

8 participants