mirror of
https://github.com/QingdaoU/OnlineJudge.git
synced 2025-11-04 14:49:58 +08:00
fix bugs
This commit is contained in:
parent
4bd5078a94
commit
c66c31f237
@ -407,7 +407,7 @@ class IDEDispatcher(DispatcherBase):
|
|||||||
def __init__(lang, code, test_case):
|
def __init__(lang, code, test_case):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
def judge(slef,lang, code, test_case):
|
def judge(self, lang, code, test_case):
|
||||||
language = lang
|
language = lang
|
||||||
sub_config = list(filter(lambda item: language == item["name"], SysOptions.languages))[0]
|
sub_config = list(filter(lambda item: language == item["name"], SysOptions.languages))[0]
|
||||||
|
|
||||||
@ -431,6 +431,5 @@ class IDEDispatcher(DispatcherBase):
|
|||||||
else:
|
else:
|
||||||
return resp["output", "cpu_time", "real_time"]
|
return resp["output", "cpu_time", "real_time"]
|
||||||
|
|
||||||
|
|
||||||
# 至此判题结束,尝试处理任务队列中剩余的任务
|
# 至此判题结束,尝试处理任务队列中剩余的任务
|
||||||
process_pending_task()
|
process_pending_task()
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import dramatiq
|
import dramatiq
|
||||||
|
|
||||||
from account.models import User
|
from account.models import User
|
||||||
from submission.models import Submission, IDE
|
from submission.models import Submission
|
||||||
from judge.dispatcher import JudgeDispatcher, IDEDispatcher
|
from judge.dispatcher import JudgeDispatcher, IDEDispatcher
|
||||||
from utils.shortcuts import DRAMATIQ_WORKER_ARGS
|
from utils.shortcuts import DRAMATIQ_WORKER_ARGS
|
||||||
|
|
||||||
@ -16,7 +16,6 @@ def judge_task(submission_id, problem_id):
|
|||||||
|
|
||||||
@dramatiq.actor(**DRAMATIQ_WORKER_ARGS())
|
@dramatiq.actor(**DRAMATIQ_WORKER_ARGS())
|
||||||
def judge_IDE_task(lang, code, test_case):
|
def judge_IDE_task(lang, code, test_case):
|
||||||
uid = IDE.user_id
|
|
||||||
if User.objects.get(id=uid).is_disabled:
|
if User.objects.get(id=uid).is_disabled:
|
||||||
return
|
return
|
||||||
IDEDispatcher(lang, code, test_case).judge()
|
IDEDispatcher(lang, code, test_case).judge()
|
||||||
|
|||||||
@ -222,5 +222,4 @@ class IDEAPI(APIView):
|
|||||||
return self.success(data)
|
return self.success(data)
|
||||||
|
|
||||||
def get(self, request):
|
def get(self, request):
|
||||||
data = judge_IDE_task.send(language, code, input)
|
return self.success
|
||||||
return self.success(data)
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user