I am not using result backend my question is that when the broker connection is lost it throws a connection refused exception which i could normally catch through the following given below code.
*try:* * add.delay(2, 2)* *except add.OperationalError as exc:* * print('error');* Reference 1: http://docs.celeryproject.org/en/latest/userguide/calling.html#connection-error-handling Reference 2: https://github.com/celery/celery/issues/3933 This try except block works only one time and next time when i try to call again add.delay(2,2)....the code is waiting to execute because celery is re-trying to establish the connection with the broker. I just simply don't want to do, for example: There is a website where a user signup as a new user and we have to send an verification email through celery and suddenly the connection gets lost then the code will be in waiting state because celery is again retrying to establish a connection with the lost broker. How can we solve this problem ? On Wednesday, January 3, 2018 at 12:45:10 AM UTC+5:30, Jason wrote: > > With a broker connection loss, the only thing that will happen is your > workers won't pick up new tasks. > > If you're posting to a result backend like redis and lose the connection, > then an exception will be raised in the logs and the task will shut down. > > Remember tasks are independent processes and you can tell each worker how > many tasks to execute before its process is killed. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/41026c20-3ca0-46bd-8bab-361eba75aadc%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.