diff --git a/mcdreforged.plugin.json b/mcdreforged.plugin.json index 4b13248..52f758c 100644 --- a/mcdreforged.plugin.json +++ b/mcdreforged.plugin.json @@ -1,6 +1,6 @@ { "id": "sakura_flow", - "version": "0.3.0", + "version": "0.3.1", "name": "Sakura Flow", "description": "一款专注于依赖管理与深度交互的 MCDReforged 待办事项插件。", "author": "Sakura-Ex", diff --git a/sakura_flow/manager.py b/sakura_flow/manager.py index dd91538..9b60a3f 100644 --- a/sakura_flow/manager.py +++ b/sakura_flow/manager.py @@ -17,6 +17,8 @@ def acquire(self): start_time = time.time() while True: try: + # 确保锁文件的父目录存在 + os.makedirs(os.path.dirname(self.lock_file), exist_ok=True) # 尝试以独占模式创建锁文件 fd = os.open(self.lock_file, os.O_CREAT | os.O_EXCL | os.O_RDWR) os.close(fd)