From 5ab004638d9df844a22ac83e197aa95c3d510d81 Mon Sep 17 00:00:00 2001 From: virusdefender <1670873886@qq.com> Date: Sat, 15 Aug 2015 17:02:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=85=8D=E7=BD=AE=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- judge/judger_controller/tasks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/judge/judger_controller/tasks.py b/judge/judger_controller/tasks.py index eee5191..ab6040f 100644 --- a/judge/judger_controller/tasks.py +++ b/judge/judger_controller/tasks.py @@ -5,7 +5,7 @@ from bson import ObjectId import subprocess32 as subprocess from ..judger.result import result from ..judger_controller.celery import app -from settings import docker_config, source_code_dir, test_case_dir, mongodb_config +from settings import docker_config, source_code_dir, test_case_dir, celery_mongodb_config @app.task @@ -24,7 +24,7 @@ def judge(submission_id, time_limit, memory_limit, test_case_id): submission_id, str(time_limit), str(memory_limit), test_case_id) subprocess.call(command, timeout=(time_limit / 1000.0 * 10), shell=docker_config["shell"]) except Exception as e: - connection = pymongo.MongoClient(host=mongodb_config["host"], port=mongodb_config["port"]) + connection = pymongo.MongoClient(host=celery_mongodb_config["host"], port=celery_mongodb_config["port"]) collection = connection["oj"]["oj_submission"] data = {"result": result["system_error"], "info": str(e)} collection.find_one_and_update({"_id": ObjectId(submission_id)}, {"$set": data})