1

Celery user guides suggests Django transaction be manually committed before calling task process.

http://celery.readthedocs.org/en/latest/userguide/tasks.html#database-transactions

I want the system to be as reliable as possible. What is the best practice to recover from a crash between transaction commit and calling task (i.e. make sure task is always called when transaction is committed).

BTW, right now I'm using database-based job queue I implemented so there is no such problem -- I can send jobs within transaction. I'm not really convinced if I should switch to Celery.

user3761759
  • 715
  • 1
  • 5
  • 8

1 Answers1

0

From django 1.9 this has been added

transaction.on_commit(lambda: add_task_to_the_queue())
James
  • 13,571
  • 6
  • 61
  • 83