使用 huey 异步队列。 ps 真想自己写一个异步队列,rq 不支持多 worker,celery 太复杂了

This commit is contained in:
virusdefender
2015-12-07 21:19:55 +08:00
parent bf6a42b5b1
commit 2f55799457
4 changed files with 19 additions and 22 deletions

9
submission/tasks.py Normal file
View File

@@ -0,0 +1,9 @@
# coding=utf-8
from huey.djhuey import task
from judge_dispatcher.tasks import JudgeDispatcher
@task()
def _judge(submission, time_limit, memory_limit, test_case_id):
JudgeDispatcher(submission, time_limit, memory_limit, test_case_id).judge()