This repository has been archived by the owner on Aug 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade to celery 5.1.2, flower 1.0.0
- Loading branch information
1 parent
d2abb22
commit 77a3e65
Showing
8 changed files
with
21 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
worker: celery worker -A reboot --without-heartbeat --without-gossip --without-mingle | ||
worker: celery --app worker --without-heartbeat --without-gossip --without-mingle | ||
web: gunicorn reboot.wsgi --log-level info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
''' | ||
Module for tasks to be sent on task queue | ||
''' | ||
from celery import task | ||
from celery import shared_task | ||
|
||
from app.worker.app_celery import AppTask | ||
from .create_receipt import Receiptor | ||
|
||
|
||
@task(bind=True, base=AppTask) | ||
@shared_task(bind=True, base=AppTask) | ||
def receiptor(self, queryset, total_count): | ||
receiptor = Receiptor(queryset, total_count) | ||
return receiptor() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
""" | ||
Module for csv file importers to be sent to queue | ||
""" | ||
from celery import task | ||
from celery import shared_task | ||
|
||
from app.worker.app_celery import AppTask | ||
|
||
from .historical_data_importer import HistoricalDataImporter | ||
|
||
|
||
@task(bind=True, base=AppTask) | ||
@shared_task(bind=True, base=AppTask) | ||
def historical_data_importer(self, csvpath): | ||
importer = HistoricalDataImporter(csvpath) | ||
importer() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
from celery import Celery | ||
from django.conf import settings | ||
import os | ||
|
||
from celery import Celery | ||
|
||
# Set the default Django settings module for the 'celery' program. | ||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'reboot.settings') | ||
|
||
app = Celery() | ||
app = Celery('reboot') | ||
|
||
# Using a string here means the worker doesn't have to serialize | ||
# the configuration object to child processes. | ||
app.config_from_object('reboot.celeryconfig') | ||
|
||
app.autodiscover_tasks(lambda: settings.INSTALLED_APPS) | ||
# Load task modules from all registered Django apps. | ||
app.autodiscover_tasks() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters