简体   繁体   中英

Django celery results does not store task results

The problem speaks for itself - django-celery-results does not store any task results.

I did everything as it was described in 'getting started' section in documentation, but still no results.

I'm using django 4.1.2 and django-celery-results 2.4.0

Here is related variables from settings.py:

CACHES = {
    'default': {
        'BACKEND': 'django.core.cache.backends.redis.RedisCache',
        'LOCATION': 'redis://redis:6379',
    }
}
CELERY_BROKER_URL = os.environ.get("CELERY_BROKER", "redis://redis:6379")
CELERY_RESULT_BACKEND = os.environ.get("CELERY_BACKEND", "django-db")
CELERY_CACHE_BACKEND = "django-cache"
CELERY_RESULT_EXTENDED = True

I also tried database cache - nothing changed. How can I get this to work?

UPD: I can create TaskResult and GroupResult objects manually with django admin panel or django shell, the problem is that they are not created automatically.

You have to migrate first then you will able to store such information.Follow this link you will get your solution for sure:

https://docs.celeryq.dev/en/stable/django/first-steps-with-django.html#django-celery-results-using-the-django-orm-cache-as-a-result-backend

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM