-
Notifications
You must be signed in to change notification settings - Fork 15
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
only() in bulk sync breaks django-cacheop's post_delete logic #17
Comments
I don't really understand what cacheops is doing to cause the problem. I don't want to remove the I don't use pre/post signals much (I don't like the paradigm, but I digress...). But since bulk_create and bulk_update don't emit signals, the delete step shouldn't either. For that reason, I should probably replace:
with something like That will probaly make cacheops not crash, but also break it since it depends on the hooks. But, it probably was already broken becuase the create and update hooks aren't being invoked. Thoughts? |
Yes you are correct, I need use cacheops.bulk_update for populate cache. And for these maybe best choice would be use bulk_compare with custom logic for bulk update, delete and insert. But due performance reasoning I don`t wont use compare by fields. |
Hi!
Cacheops have automatic invalidation logic by post_save signal, but with "only" chain method this logic is not working correctly (see this comment Suor/django-cacheops#348 (comment)).
Can i remove this method? And for "only" case we can use managed=False models with subset of fields as recommended in django doc for defer/only methods (https://docs.djangoproject.com/en/3.1/ref/models/querysets/#defer).
The text was updated successfully, but these errors were encountered: