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

Update the after_filter for auto-commit to be overridable on a per class basis. #803

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

rgarver
Copy link

@rgarver rgarver commented Aug 5, 2016

We have situations where a controller should avoid committing to Solr since the immediate availability of a document is not critical. The case we use this for is on API calls where we want to do the indexing inline (so we give some back-pressure on the caller) but the update doesn't need to be immediately available. These API calls happen frequently so reducing load on Solr is important.

This could be implemented with the auto_commit_after_request: false option, and then add the commit as an after_filter everywhere we want it, but this use case is a bit of an inversion of how auto_commit_after_request is best used.

@sdhull
Copy link

sdhull commented Aug 5, 2016

Generally good practice to have before_filter and after_filter be named methods, which allows developers to override or use skip_before_filter. 👍

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

Successfully merging this pull request may close these issues.

None yet

2 participants