for loop + transaction.on_commit + celery = Unexpected Behaviour

2017-04-24 Thread Emilio Jimenez Canalejo
Hi, I've been looking for some time around the internet a problem I have, maybe I'm just dull from all the searching and the answer is pretty obvious, but I can't find it. For example, I have code like this: @app.task def foo(idx): print("This is iteration {}".format(idx)) def save_model(se

Re: for loop + transaction.on_commit + celery = Unexpected Behaviour

2017-04-24 Thread Emilio Jimenez Canalejo
I'm not too familiar with Celery, but I think that for loop continuously > keeps changing transaction's commit event handler. Maybe you are looking > for something like transaction.commit instead of on_commit? > On Apr 24, 2017 2:37 PM, Emilio Jimenez Canalejo > wrote: > &