mirror of
https://github.com/QingdaoU/OnlineJudge.git
synced 2024-09-21 08:23:20 +00:00
删除 celery 依赖
This commit is contained in:
parent
f1449962e4
commit
43e8ec2d90
@ -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
|
@ -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
|
||||
|
17
oj/celery.py
17
oj/celery.py
@ -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)
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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:
|
||||
|
@ -1 +0,0 @@
|
||||
nohup celery -A judge.judger_controller worker -l DEBUG &
|
Loading…
Reference in New Issue
Block a user