修改计数方式
This commit is contained in:
@@ -10,8 +10,6 @@ from settings import docker_config, source_code_dir, test_case_dir, submission_d
|
||||
|
||||
@app.task
|
||||
def judge(submission_id, time_limit, memory_limit, test_case_id):
|
||||
r = redis.Redis(host=redis_config["host"], port=redis_config["port"], db=redis_config["db"])
|
||||
r.incr("judge_queue_length")
|
||||
try:
|
||||
command = "%s run -t -i --privileged --rm=true " \
|
||||
"-v %s:/var/judger/test_case/ " \
|
||||
@@ -39,4 +37,5 @@ def judge(submission_id, time_limit, memory_limit, test_case_id):
|
||||
(result["system_error"], str(e), submission_id))
|
||||
conn.commit()
|
||||
conn.close()
|
||||
r = redis.Redis(host=redis_config["host"], port=redis_config["port"], db=redis_config["db"])
|
||||
r.decr("judge_queue_length")
|
||||
Reference in New Issue
Block a user