chore: 更新配置文件和日志路径

- 在 docker-compose.yml 中新增测试目录挂载。
- 修改 __init__.py 文件,更新配置文件路径以使用 save_dir 变量。
- 更新 logging_config.py 文件,调整日志文件路径至 tmp/logs,并确保相应目录存在。
- 移动 test/test_neo4j.py 文件
This commit is contained in:
Wenjie Zhang 2025-06-26 02:13:46 +08:00
parent bb4ce9e5c2
commit 57299fda8d
5 changed files with 5 additions and 4 deletions

View File

@ -13,6 +13,7 @@ services:
- ./server:/app/server
- ./src:/app/src
- ./saves:/app/saves
- ./test:/app/test
- ${MODEL_DIR:-./models}:/models # 使用默认值处理未定义的环境变量
deploy:
resources:

View File

@ -40,7 +40,7 @@ class Config(SimpleConfig):
super().__init__()
self._config_items = {}
self.save_dir = "saves"
self.filename = str(Path("saves/config/base.yaml"))
self.filename = str(Path(f"{self.save_dir}/config/base.yaml"))
os.makedirs(os.path.dirname(self.filename), exist_ok=True)
self._update_models_from_file()

View File

@ -7,10 +7,10 @@ from loguru import logger as loguru_logger
DATETIME = datetime.now(pytz.timezone('Asia/Shanghai')).strftime('%Y-%m-%d-%H%M%S')
# DATETIME = "debug" # 为了方便,调试的时候输出到 debug.log 文件
LOG_FILE = f'saves/log/project-{DATETIME}.log'
LOG_FILE = f'tmp/logs/project-{DATETIME}.log'
def setup_logger(name, level="DEBUG", console=True):
"""使用 loguru 设置日志记录器"""
os.makedirs("saves/log", exist_ok=True)
os.makedirs("tmp/logs", exist_ok=True)
# 移除默认的 handler
loguru_logger.remove()

View File

@ -1448,7 +1448,7 @@ const handleBatchIndex = async () => {
padding: 10px;
border-radius: 4px;
margin: 8px 0;
background-color: var(--gray-200);
background-color: var(--gray-100);
&:hover {
background-color: var(--main-light-4);