django-background-task icon indicating copy to clipboard operation
django-background-task copied to clipboard

Patched lock method so it works in django-nonrel

Open urtzurd opened this issue 11 years ago • 2 comments

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 avatar Jul 03 '13 13:07 urtzurd

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

philippeowagner avatar Apr 30 '15 22:04 philippeowagner

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 .

urtzurd avatar May 01 '15 09:05 urtzurd