Friday, 22 February 2019

Configure celery to wait for backend service to start

When starting up celery, it retries connecting to my rabbitmq broker, which gives it the necessary time to load. This is good, because I'm using docker and I can't guarantee the order in which services start and precisely which service will be up when.

However, while trying to connect to the local mysql server I set up as the results backend, celery does not use the same measure of mercy and dies instantly, complaining, reasonably, that it can't lock the mysqld socket:

OperationalError: (2002, "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)")

I would like to configure celery to retry several times before giving up, is that possible?

Thanks!



from Configure celery to wait for backend service to start

No comments:

Post a Comment