增加部分logger配置

This commit is contained in:
virusdefender 2016-04-07 16:19:39 +08:00
parent b3116cc430
commit 90801f7f7e
2 changed files with 4 additions and 5 deletions

View File

@ -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):

View File

@ -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"])