修改判题端的部分 bug

This commit is contained in:
virusdefender
2015-08-13 18:15:00 +08:00
parent 5273e9a48d
commit da03f902c5
3 changed files with 33 additions and 10 deletions

View File

@@ -14,7 +14,7 @@ def judge(solution_id, time_limit, memory_limit, test_case_id):
"python judger/run.py "
"--solution_id %s --time_limit %s --memory_limit %s --test_case_id %s" %
(solution_id, str(time_limit), str(memory_limit), test_case_id),
# 如果设置最长运行时间小于1000毫秒那么/1000就是0处理一下这个情况设置为两秒
timeout=(time_limit / 1000 * 3) or 2, shell=True)
# 设置最长运行时间是3倍的 cpu 时间
timeout=(time_limit / 1000.0 * 3), shell=True)
except subprocess.TimeoutExpired:
print "docker timeout"