Can we use django celery results for remote workers? #387
Replies: 2 comments
-
Hey there, When i was using django-celery-results I was hoping that the results that are updated in the redis_backend would be sychronized with the django-db but that is not the case. However as a workaround: dependencies: settings.py:
you can start pure celery workers and the worker will update the results into the django-db of your given db-connection from settings.py # app.py
from __future__ import absolute_import, unicode_literals
from django.conf import settings
from celery import Celery
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "myproject.settings")
app = Celery('myapp', broker='redis://localhost:6379/0', backend='django-db://')
app.autodiscover_tasks(["path.to.taskfile",]) There is maybe a better way of doing this. |
Beta Was this translation helpful? Give feedback.
-
As a small followup, I have reduced almost everything from the created django-project. this is my structure now:
settings.py (local.py) - but a lot of stuff removed
requirements.txt
so when using |
Beta Was this translation helpful? Give feedback.
-
Greetings!
I'm encountering an issue with my Django app that I'm hoping to get some assistance with. I've noticed that when I connect a remote worker that doesn't have access to my Django app configuration, the result cannot be stored correctly. Strangely enough, everything seems to be working perfectly fine when I run everything locally.
I was wondering if anyone has had success with a similar setup and could provide some guidance or resources. Is there any documentation out there that might be useful in my situation?
I just need to know what setting I need to enter for my remote worker configuration. Currently using postgresql that can be opened to outside connections if needed.
I would greatly appreciate any help or insights you might have on this matter. Thank you in advance for your time and attention.
Best regards.
GL.
Beta Was this translation helpful? Give feedback.
All reactions