Skip to content

Commit 6fd5801

Browse files
authored
Fix/sehculder task file not detection 0210 (alibaba#465)
* add release note 120 * Revert "add release note 120" This reverts commit 65a11fd. * fix scheduler task file not found detection
1 parent 89fa9bc commit 6fd5801

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

rock/admin/scheduler/task_base.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,9 @@ async def single_run(self, runtime: RemoteSandboxRuntime, ip: str) -> dict:
151151

152152
async def get_task_status(self, runtime: RemoteSandboxRuntime) -> TaskStatus | None:
153153
"""Get task status from worker."""
154-
try:
155-
await runtime.execute(Command(command=f"ls {self.status_file_path}", shell=True))
156-
except Exception:
157-
logger.info(f"{self.status_file_path} not found")
154+
check_file_resp = await runtime.execute(Command(command=f"ls {self.status_file_path}", shell=True))
155+
if check_file_resp.exit_code == 2:
156+
logger.info(f"task status file not exist: {self.status_file_path}")
158157
return None
159158

160159
response = await runtime.read_file(ReadFileRequest(path=self.status_file_path))

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)