diff --git a/desktop_env/envs/__init__.py b/desktop_env/envs/__init__.py index b049d50..24a5b37 100644 --- a/desktop_env/envs/__init__.py +++ b/desktop_env/envs/__init__.py @@ -12,7 +12,7 @@ import psutil import requests from tqdm import tqdm -__version__ = "0.1.12" +__version__ = "0.1.15" MAX_RETRY_TIMES = 10 UBUNTU_ARM_URL = "https://huggingface.co/datasets/xlangai/ubuntu_arm/resolve/main/Ubuntu.zip" @@ -78,10 +78,16 @@ class VirtualMachineManager: active_pids = {p.pid for p in psutil.process_iter()} new_lines = [] vm_paths = [] + with open(self.registry_path, 'r') as file: lines = file.readlines() for line in lines: vm_path, pid_str = line.strip().split('|') + if not os.path.exists(vm_path): + print(f"VM {vm_path} not found, releasing it.") + new_lines.append(f'{vm_path}|free\n') + continue + vm_paths.append(vm_path) if pid_str == "free": new_lines.append(line)