删除 celery 依赖

This commit is contained in:
virusdefender 2015-12-07 19:15:28 +08:00
parent f1449962e4
commit 43e8ec2d90
7 changed files with 15 additions and 38 deletions

View File

@ -4,11 +4,12 @@ redis
django-redis-sessions
djangorestframework
django-rest-swagger
celery
gunicorn
coverage
django-extensions
supervisor
pillow
jsonfield
Envelopes
Envelopes
rq
django-rq

View File

@ -7,8 +7,3 @@
|___/ |___/ |_|
https://github.com/QingdaoU/OnlineJudge
"""
from __future__ import absolute_import
# 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

View File

@ -1,17 +0,0 @@
from __future__ import absolute_import
import os
from celery import Celery
# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'oj.settings')
from django.conf import settings
app = Celery('oj')
# Using a string here means the worker will not have to
# pickle the object when using Windows.
app.config_from_object('django.conf:settings')
app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)

View File

@ -22,10 +22,11 @@ REDIS_CACHE = {
"db": 1
}
# for celery
REDIS_HOST = "localhost"
REDIS_PORT = 6379
REDIS_DB = 0
REDIS_QUEUE = {
"host": "127.0.0.1",
"port": 6379,
"db": 2
}
DEBUG = True

View File

@ -31,10 +31,12 @@ REDIS_CACHE = {
"db": 1
}
# for celery
REDIS_HOST = os.environ.get("REDIS_PORT_6379_TCP_ADDR", "127.0.0.1")
REDIS_PORT = 6379
REDIS_DB = 0
REDIS_QUEUE = {
"host": os.environ.get("REDIS_PORT_6379_TCP_ADDR", "127.0.0.1"),
"port": 6379,
"db": 2
}
DEBUG = False

View File

@ -22,9 +22,6 @@ if ENV == "local":
elif ENV == "server":
from .server_settings import *
import djcelery
djcelery.setup_loader()
BROKER_BACKEND = "redis"
CELERY_ACCEPT_CONTENT = ['json']
CELERY_TASK_SERIALIZER = 'json'
@ -63,8 +60,7 @@ INSTALLED_APPS = (
'judge_dispatcher',
'django_extensions',
'rest_framework',
'djcelery',
'rest_framework'
)
if DEBUG:

View File

@ -1 +0,0 @@
nohup celery -A judge.judger_controller worker -l DEBUG &