From 272169c0c837e82e9ccf26d4a3d7b0110b81cf63 Mon Sep 17 00:00:00 2001 From: virusdefender <1670873886@qq.com> Date: Sat, 15 Aug 2015 17:49:51 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E5=AF=B9=20subprocess32?= =?UTF-8?q?=E7=9A=84=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- judge/judger_controller/tasks.py | 2 +- requirements.txt | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/judge/judger_controller/tasks.py b/judge/judger_controller/tasks.py index ab6040f4..3313b524 100644 --- a/judge/judger_controller/tasks.py +++ b/judge/judger_controller/tasks.py @@ -1,8 +1,8 @@ # coding=utf-8 # from __future__ import absolute_import +import subprocess import pymongo 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, celery_mongodb_config diff --git a/requirements.txt b/requirements.txt index 324d7b0d..885d7b2b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,5 +7,4 @@ django-rest-swagger celery gunicorn coverage -subprocess32 pymongo \ No newline at end of file From 397927ef21e7b3380f30e24491c402a9d9875af0 Mon Sep 17 00:00:00 2001 From: virusdefender <1670873886@qq.com> Date: Sat, 15 Aug 2015 17:52:07 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E5=90=AF=E5=8A=A8=20dock?= =?UTF-8?q?er=20=E7=9A=84=E8=B6=85=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- judge/judger_controller/tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/judge/judger_controller/tasks.py b/judge/judger_controller/tasks.py index 3313b524..f9187244 100644 --- a/judge/judger_controller/tasks.py +++ b/judge/judger_controller/tasks.py @@ -22,7 +22,7 @@ def judge(submission_id, time_limit, memory_limit, test_case_id): source_code_dir, docker_config["image_name"], submission_id, str(time_limit), str(memory_limit), test_case_id) - subprocess.call(command, timeout=(time_limit / 1000.0 * 10), shell=docker_config["shell"]) + subprocess.call(command, shell=docker_config["shell"]) except Exception as e: connection = pymongo.MongoClient(host=celery_mongodb_config["host"], port=celery_mongodb_config["port"]) collection = connection["oj"]["oj_submission"]