From 12e2c54aad20c2683d7a0dfed6f8bde3735e0b02 Mon Sep 17 00:00:00 2001 From: virusdefender <1670873886@qq.com> Date: Thu, 17 Sep 2015 09:29:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F?= =?UTF-8?q?=E4=B8=AD=E5=8F=96=E6=95=B0=E6=8D=AE=E5=BA=93=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- judge/judger_controller/settings.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/judge/judger_controller/settings.py b/judge/judger_controller/settings.py index e141c52..6e24f59 100644 --- a/judge/judger_controller/settings.py +++ b/judge/judger_controller/settings.py @@ -4,9 +4,10 @@ 此文件包含 celery 的部分配置,但是 celery 并不是运行在docker 中的,所以本配置文件中的 redis和 MySQL 的地址就应该是 运行 redis 和 MySQL 的 docker 容器的地址了。怎么获取这个地址见帮助文档。测试用例的路径和源代码路径同理。 """ +import os # 这个redis 是 celery 使用的,包括存储队列信息还有部分统计信息 redis_config = { - "host": "192.168.42.23", + "host": os.environ.get("celery_redis_host"), "port": 6379, "db": 0 } @@ -30,7 +31,7 @@ log_dir = "/root/log/" # 存储提交信息的数据库,是 celery 使用的,与 oj.settings/local_settings 等区分,那是 web 服务器访问的地址 submission_db = { - "host": "192.168.42.32", + "host": os.environ.get("submission_db_host"), "port": 3306, "db": "oj_submission", "user": "root",