lilspikey / django-background-task

A database-backed work queue for Django
BSD 3-Clause "New" or "Revised" License
107 stars 200 forks source link

Patched lock method so it works in django-nonrel #7

Open urtzurd opened 11 years ago

urtzurd commented 11 years ago

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.

philippeowagner commented 9 years ago

@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?

urtzurd commented 9 years ago

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 notifications@github.com:

@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 .