Patched lock method so it works in django-nonrel#7
Patched lock method so it works in django-nonrel#7urtzurd wants to merge 1 commit intolilspikey:masterfrom
Conversation
|
@urtzurd has been a while. I'm not familiar with django-nonrel. Does this PR (still) work in production and does this still have a relevance? Should we review and integrate your PR into django-background-tasks? |
|
Hi! It has been a while indeed, and I haven't worked with django-nonrel in any Thanks! 2015-04-30 23:28 GMT+01:00 Philippe O. Wagner notifications@github.com:
|
I'm using django-background-task with the django-nonrel branch and it seems not to be working because a limitation of django-nonrel itself: when doing model updates, it doesn't return the number of records changed.
Having a look to the code, it seems that this small change should be enough to avoid that problem and have it running in django-nonrel (it supports atomic updates according to the documentation). Efficiency wise it would be running an extra query only when a lock acquisition has failed, and that shouldn't happen that frequently unless you are running many consumers at exactly the same time.