From 6c209b115a3dc2c378b43b37c4fa3438c8b6b512 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Sat, 19 Sep 2026 13:12:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=92=E7=83=9F=E7=A4=BA=E4=BE=8B=E5=9C=A8?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=9C=AA=E5=AE=8C=E6=88=90=E6=97=B6=E8=B7=B3?= =?UTF-8?q?=E8=BF=87=E4=B8=8B=E8=BD=BD=E5=B9=B6=E7=BB=A7=E7=BB=AD=E5=90=8E?= =?UTF-8?q?=E7=BB=AD=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 轮询改用 throw_on_failure=false,失败终态交回示例按 status 判定而不是直接返回错误 非 Completed 的任务打印 status 与 failure 后 continue,避免一个入口失败中断其余入口的冒烟 --- .../examples/tripo_generation_smoke.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/server-rs/crates/platform-tripo/examples/tripo_generation_smoke.rs b/server-rs/crates/platform-tripo/examples/tripo_generation_smoke.rs index c58fd9f28..abc010eac 100644 --- a/server-rs/crates/platform-tripo/examples/tripo_generation_smoke.rs +++ b/server-rs/crates/platform-tripo/examples/tripo_generation_smoke.rs @@ -16,7 +16,7 @@ use std::{env, fs, time::Duration}; use platform_tripo::TripoProviderClient; use shared_contracts::model3d::{ - common::{Model3dModelVersion, Model3dTextureQuality}, + common::{Model3dModelVersion, Model3dTaskStatus, Model3dTextureQuality}, image_to_model::Model3dImageToModelRequest, multiview_to_model::{Model3dMultiviewInputs, Model3dMultiviewToModelRequest}, text_to_model::Model3dTextToModelRequest, @@ -140,6 +140,9 @@ async fn main() -> Result<(), Box> { &handle.task_id, WaitOptions { timeout: Some(Duration::from_secs(30 * 60)), + // Non-success terminal states are reported below by status + // so the remaining endpoints are still exercised. + throw_on_failure: false, ..WaitOptions::default() }, ) @@ -151,6 +154,14 @@ async fn main() -> Result<(), Box> { snapshot.status, snapshot.progress, snapshot.output ); + if snapshot.status != Model3dTaskStatus::Completed { + eprintln!( + "{name} skipped download: status={:?} failure={:?}", + snapshot.status, snapshot.failure + ); + continue; + } + let downloaded = client.download_model(&snapshot).await?; let filename = downloaded.filename(name); fs::write(&filename, &downloaded.data)?;