diff --git a/rock/admin/scheduler/task_base.py b/rock/admin/scheduler/task_base.py index cde082872..6fc7bdfac 100644 --- a/rock/admin/scheduler/task_base.py +++ b/rock/admin/scheduler/task_base.py @@ -151,10 +151,9 @@ async def single_run(self, runtime: RemoteSandboxRuntime, ip: str) -> dict: async def get_task_status(self, runtime: RemoteSandboxRuntime) -> TaskStatus | None: """Get task status from worker.""" - try: - await runtime.execute(Command(command=f"ls {self.status_file_path}", shell=True)) - except Exception: - logger.info(f"{self.status_file_path} not found") + check_file_resp = await runtime.execute(Command(command=f"ls {self.status_file_path}", shell=True)) + if check_file_resp.exit_code == 2: + logger.info(f"task status file not exist: {self.status_file_path}") return None response = await runtime.read_file(ReadFileRequest(path=self.status_file_path)) diff --git a/uv.lock b/uv.lock index fbef1e517..86b59acd9 100644 --- a/uv.lock +++ b/uv.lock @@ -4011,7 +4011,7 @@ wheels = [ [[package]] name = "rl-rock" -version = "1.0.2" +version = "1.2.1" source = { editable = "." } dependencies = [ { name = "anyio" },