Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Add auto restart for celery" #172

Merged
merged 1 commit into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ The chirps application makes use of Celery and RabbitMQ for job processing. Exec

Both the rabbitmq and celery commands have `--stop` and `--restart` options as well.

#### IMPORTANT CELERY TIP

If you make changes to a Celery task, it must be restarted in order for those changes to be picked up. Simply run
`./manage.py celery --restart`

### Run Webserver

`./manage.py runserver`
Expand Down
6 changes: 2 additions & 4 deletions chirps/base_app/management/commands/celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import os

from django.core.management.base import BaseCommand
from django.utils import autoreload


class Command(BaseCommand):
Expand All @@ -19,13 +18,12 @@ def add_arguments(self, parser):
def handle(self, *args, **options):
"""Handle the command."""
if options['start']:
self.stop()
autoreload.run_with_reloader(self.start)
self.start()
elif options['stop']:
self.stop()
elif options['restart']:
self.stop()
autoreload.run_with_reloader(self.start)
self.start()

def start(self):
"""Start the celery server."""
Expand Down
Loading