derrickx 1 год назад
Родитель
Сommit
2b25ebf135
1 измененных файлов с 4 добавлено и 2 удалено
  1. 4 2
      tools/redis_pool.py

+ 4 - 2
tools/redis_pool.py

@@ -8,9 +8,11 @@ class redis_pool:
     instance = None
 
     def __init__(self):
-        # 读取 YAML 文件
-        current_dir = os.path.dirname(os.path.abspath(__file__))
+        # 获取当前目录
+        current_dir = os.path.dirname(__file__)
+        # 使用相对路径访问 config.yaml 文件
         config_file = os.path.join(current_dir, 'config.yaml')
+
         with open(config_file, 'r') as file:
             config = yaml.load(file, Loader=yaml.FullLoader)