lilspikey/django-background-task — pull request #7 by urtzurd (2013-07-03 13:31:41+00:00)
Title: 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.