django-background-task
django-background-task copied to clipboard
Patched lock method so it works in django-nonrel
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.
@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 other project since then. I'd say that it's no longer relevant as the current MongoDB version supports returning the number of entries modified after an update. So I guess that the newer versions of django-nonrel should make use of that functionality.
Thanks!
2015-04-30 23:28 GMT+01:00 Philippe O. Wagner [email protected]:
@urtzurd https://github.com/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 https://github.com/arteria/django-background-tasks?
— Reply to this email directly or view it on GitHub https://github.com/lilspikey/django-background-task/pull/7#issuecomment-97989578 .