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
|
django-redis-sessions
|
||||||
djangorestframework
|
djangorestframework
|
||||||
django-rest-swagger
|
django-rest-swagger
|
||||||
celery
|
|
||||||
gunicorn
|
gunicorn
|
||||||
coverage
|
coverage
|
||||||
django-extensions
|
django-extensions
|
||||||
supervisor
|
supervisor
|
||||||
pillow
|
pillow
|
||||||
jsonfield
|
jsonfield
|
||||||
Envelopes
|
Envelopes
|
||||||
|
rq
|
||||||
|
django-rq
|
@ -7,8 +7,3 @@
|
|||||||
|___/ |___/ |_|
|
|___/ |___/ |_|
|
||||||
https://github.com/QingdaoU/OnlineJudge
|
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
|
"db": 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# for celery
|
REDIS_QUEUE = {
|
||||||
REDIS_HOST = "localhost"
|
"host": "127.0.0.1",
|
||||||
REDIS_PORT = 6379
|
"port": 6379,
|
||||||
REDIS_DB = 0
|
"db": 2
|
||||||
|
}
|
||||||
|
|
||||||
DEBUG = True
|
DEBUG = True
|
||||||
|
|
||||||
|
@ -31,10 +31,12 @@ REDIS_CACHE = {
|
|||||||
"db": 1
|
"db": 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# for celery
|
REDIS_QUEUE = {
|
||||||
REDIS_HOST = os.environ.get("REDIS_PORT_6379_TCP_ADDR", "127.0.0.1")
|
"host": os.environ.get("REDIS_PORT_6379_TCP_ADDR", "127.0.0.1"),
|
||||||
REDIS_PORT = 6379
|
"port": 6379,
|
||||||
REDIS_DB = 0
|
"db": 2
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
DEBUG = False
|
DEBUG = False
|
||||||
|
|
||||||
|
@ -22,9 +22,6 @@ if ENV == "local":
|
|||||||
elif ENV == "server":
|
elif ENV == "server":
|
||||||
from .server_settings import *
|
from .server_settings import *
|
||||||
|
|
||||||
import djcelery
|
|
||||||
djcelery.setup_loader()
|
|
||||||
|
|
||||||
BROKER_BACKEND = "redis"
|
BROKER_BACKEND = "redis"
|
||||||
CELERY_ACCEPT_CONTENT = ['json']
|
CELERY_ACCEPT_CONTENT = ['json']
|
||||||
CELERY_TASK_SERIALIZER = 'json'
|
CELERY_TASK_SERIALIZER = 'json'
|
||||||
@ -63,8 +60,7 @@ INSTALLED_APPS = (
|
|||||||
'judge_dispatcher',
|
'judge_dispatcher',
|
||||||
|
|
||||||
'django_extensions',
|
'django_extensions',
|
||||||
'rest_framework',
|
'rest_framework'
|
||||||
'djcelery',
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if DEBUG:
|
if DEBUG:
|
||||||
|
@ -1 +0,0 @@
|
|||||||
nohup celery -A judge.judger_controller worker -l DEBUG &
|
|
Loading…
Reference in New Issue
Block a user