废弃 huey,多数据库连接的时候存在 connection 无法释放的问题,回到 celery

This commit is contained in:
virusdefender
2015-12-12 15:41:57 +08:00
parent 84d390362b
commit b687d2067b
14 changed files with 85 additions and 40 deletions

View File

@@ -1,9 +1,9 @@
# coding=utf-8
from huey.djhuey import db_task
from __future__ import absolute_import
from celery import shared_task
from judge_dispatcher.tasks import JudgeDispatcher
@db_task()
def _judge(submission, time_limit, memory_limit, test_case_id, is_waiting_task=False):
JudgeDispatcher(submission, time_limit, memory_limit, test_case_id).judge(is_waiting_task)
@shared_task
def _judge(submission, time_limit, memory_limit, test_case_id):
JudgeDispatcher(submission, time_limit, memory_limit, test_case_id).judge()