fix: cargo check --lib error

This commit is contained in:
imeepos 2025-08-08 15:39:25 +08:00
parent fe97cba88d
commit 6cc4e21044
2 changed files with 5 additions and 11 deletions

View File

@ -205,16 +205,10 @@ impl ComfyUIManager {
self.config.read().await.clone() self.config.read().await.clone()
} }
/// 获取客户端引用(用于高级操作) /// 检查客户端是否连接
pub async fn get_client(&self) -> Result<ComfyUIClient> { pub async fn is_connected(&self) -> bool {
let client_guard = self.client.read().await; let client_guard = self.client.read().await;
match client_guard.as_ref() { client_guard.is_some()
Some(client) => {
// 返回客户端的克隆
Ok(client.clone())
}
None => Err(anyhow!("客户端未连接")),
}
} }
/// 自动重连 /// 自动重连

View File

@ -182,7 +182,7 @@ impl TemplateEngine {
/// 预览模板实例(不执行) /// 预览模板实例(不执行)
pub async fn preview_instance(&self, template_id: &str, parameters: ParameterValues) -> Result<ComfyUIWorkflow> { pub async fn preview_instance(&self, template_id: &str, parameters: ParameterValues) -> Result<ComfyUIWorkflow> {
let instance = self.create_instance(template_id, parameters).await?; let instance = self.create_instance(template_id, parameters).await?;
Ok(instance.get_workflow().clone()) Ok(instance.workflow().clone())
} }
/// 获取模板的参数定义 /// 获取模板的参数定义
@ -227,7 +227,7 @@ impl TemplateEngine {
/// 预热模板缓存 /// 预热模板缓存
pub async fn warm_cache(&self) -> Result<()> { pub async fn warm_cache(&self) -> Result<()> {
let templates = self.repository.list_templates(true).await?; let templates = self.repository.list_templates(true)?;
{ {
let mut cache = self.template_cache.write().await; let mut cache = self.template_cache.write().await;