auto_update class attribute added for AbstractWhoosheer #19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Decides if a whoosheer should be updated by on_commit method.
Default value is True and it can be changed in a user-specified whoosheer:
The rationale for this feature is that index updates in our system can take a long time (around 0.8s) and if there are several concurrent requests to update the search index, some of them occasionally time out with 'LockError'. That's why we need to switch from continuous auto-updating of the search index to updating in batches (every hour, e.g.) and only for those records that have been modified (this is covered by a piece of custom logic).
The optimization here is that if a db record was modified many times in the passed hour, the search index record will be modified only once. Also search index updating will become sequential and hence proof to lock errors caused by many concurrent accesses.
Our index has become very large lately and that is why we need this. I'll add README and tests if you will agree with this feature.