Open timotei-za opened 2 years ago
Singleton requires redis for the locking backend, but redis does not need to be your broker.
Set CELERY_SINGLETON_BACKEND_URL
to a valid redis url. You can then use rabbitmq as a broker.
@steinitzu same. This doesn't work!
@steinitzu Do you have another proposal? 😃
Had the same error. This worked for me (Django example, using old Celery 4.3.1):
app.config_from_object('django.conf:settings', namespace='CELERY')
app.conf.singleton_backend_url = settings.CELERY_SINGLETON_BACKEND_URL
Problem: Singleton base are not supported if rabbitmq broker are used to assimilate the tasks. Error: Redis URL must specify one of the following schemes (redis://, rediss://, unix://)
If there is another way to use singleton with the rabbitmq broker, I would be very grateful to know. Thanks!
recap: the problem is that when I use rabbitmq as a broker, I can't use Singleton property inside of decorator as a base, because parse_url method doesn't support the rabbitmq system
env.config file:
tasks.py file:
create_user.py file: