Pergunta

I just started a project to try and get a very simple Django Celery project up and going. Since I'm mainly just trying to see how it works, here's what my settings look like:

BROKER_TRANSPORT = "django"
CELERY_ALWAYS_EAGER = True
CELERYBEAT_SCHEDULER = "djcelery.schedulers.DatabaseScheduler"

I've tested posting tasks with apply_async() and by scheduling them in the Django admin site and both work great.

The only problem I'm currently seeing is that I need to run two separate processes to test my tasks, django runserver and django celerybeat. When I change a periodic task, I need to restart the celerybeat process to make it reload. Is there any way that I can run the celerybeat process integrated with runserver so as to avoid having to remember to start the other process?

Foi útil?

Solução

I haven't used it myself, but it appears that you should check out the django-supervisor project. My understanding is it can be configured to automatically reload content for any number of concurrently running processes that are run with your webserver.

Alternatively, you could use celery 2.5's --autoreload feature. More details on this in the release notes.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top