mirror of
https://github.com/QingdaoU/OnlineJudge.git
synced 2025-01-01 10:02:01 +00:00
增加部分logger配置
This commit is contained in:
parent
b3116cc430
commit
90801f7f7e
@ -1,10 +1,8 @@
|
||||
# coding=utf-8
|
||||
import time
|
||||
import os
|
||||
import judger
|
||||
from judge_exceptions import CompileError, JudgeClientError
|
||||
from judge_exceptions import CompileError
|
||||
from logger import logger
|
||||
from settings import judger_workspace
|
||||
|
||||
|
||||
def compile_(language_item, src_path, exe_path, judge_base_path, compile_spj=False):
|
||||
|
@ -3,6 +3,7 @@ import os
|
||||
import socket
|
||||
import shutil
|
||||
|
||||
from logger import logger
|
||||
from client import JudgeClient
|
||||
from language import languages
|
||||
from compiler import compile_
|
||||
@ -19,6 +20,8 @@ class JudgeInstanceRunner(object):
|
||||
judge_base_path = os.path.join(judger_workspace, "run", submission_id)
|
||||
|
||||
if not token or token != os.environ.get("rpc_token"):
|
||||
if token:
|
||||
logger.info("Invalid token: " + token)
|
||||
return {"code": 2, "data": {"error": "Invalid token", "server": host_name}}
|
||||
|
||||
try:
|
||||
@ -78,8 +81,6 @@ class JudgeInstanceRunner(object):
|
||||
for item in judge_result["info"]:
|
||||
if item["result"] != 0:
|
||||
judge_result["result"] = item["result"]
|
||||
if item.get("error"):
|
||||
judge_result["info"] = item["error"]
|
||||
break
|
||||
else:
|
||||
l = sorted(judge_result["info"], key=lambda k: k["cpu_time"])
|
||||
|
Loading…
Reference in New Issue
Block a user