re: Django: Fixing race condition when queuing with on_commit hook VIEW POST

FULL DISCUSSION
 

What if instead of hooking to the transaction callbacks you send the message on the queue with a signal on post_save ?

This way if there is an error the message won't be saved or queued, if the message is saved in the database you can be sure that it is sent to the queue after being saved

 

Hmm, that make sense. I'll look back into our code and see if that feasible. Thanks for the suggestion !

Ok, on a second thought, I try to avoid using signal as it make code hard to follow.

 

He has a point, thanks for telling me! I'll consider it :-)

code of conduct - report abuse