remove celery from project

This commit is contained in:
Robert Einsle 2017-08-04 17:49:33 +02:00
parent 81d9b7f29c
commit 79233c408e
5 changed files with 1 additions and 48 deletions

View File

@ -2,13 +2,12 @@ from __future__ import absolute_import, unicode_literals
import logging
import billard.utils as utils
from celery import shared_task
from billard.models import LocationData, Client, Accounting
log = logging.getLogger(__name__)
@shared_task
def process_location_data():
data = LocationData.objects.filter(processed=False).order_by('tst')
for ld in data:

View File

@ -1,7 +0,0 @@
from __future__ import absolute_import, unicode_literals
# This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
from .celery import app as celery_app
__all__ = ['celery_app']

View File

@ -1,28 +0,0 @@
from __future__ import absolute_import, unicode_literals
import os
import django
from celery import Celery
from django.conf import settings
# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'caromserver.settings')
app = Celery(settings.CELERY_PREFIX)
# Using a string here means the worker don't have to serialize
# the configuration object to child processes.
# - namespace='CELERY' means all celery-related configuration keys
# should have a `CELERY_` prefix.
app.config_from_object('django.conf:settings')
# Load task modules from all registered Django app configs.
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "caromserver.settings")
django.setup()
app.autodiscover_tasks(['billard'])
@app.task(bind=True)
def debug_task(self):
print('Request: {0!r}'.format(self.request))

View File

@ -138,14 +138,6 @@ LOGOUT_URL = 'logout'
LOGIN_REDIRECT_URL = 'billard:location_index'
LOGOUT_REDIRECT_URL = 'billard:location_index'
# CELERY STUFF
BROKER_URL = 'redis://localhost:6379'
CELERY_RESULT_BACKEND = 'redis://localhost:6379'
CELERY_ACCEPT_CONTENT = ['application/json']
CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'
CELERY_TIMEZONE = 'Europe/Berlin'
# Admin eMails
ADMINS = (
('Robert Einsle', 'robert@einsle.de'),
@ -162,8 +154,6 @@ URL_LOCATION_PROCESSOR = 'http://127.0.0.1:8000/billard/process_locationdata'
STATIC_ROOT = "/srv/carom/carom-server/static/"
CELERY_PREFIX = 'carom'
try:
from local_settings import *
except ImportError:

View File

@ -1,4 +1,3 @@
celery==4.0.2
Django>=1.11
django-crispy-forms==1.6.1
django-extensions>=1.7.0