Fix local filetree page tree open performance

This commit is contained in:
lix-2026
2026-05-27 12:53:55 +08:00
parent 3ae33cc21d
commit c01dc2dea2
10 changed files with 730 additions and 47 deletions
+10 -2
View File
@@ -125,7 +125,9 @@ async fn project_projection(
}
})
.await
.map_err(|error| WebError::internal(format!("本地树 projection 构建任务失败: {error}")))??;
.map_err(|error| {
WebError::internal(format!("本地树 projection 构建任务失败: {error}"))
})??;
return Ok(ok_response(&context, snapshot.projection));
}
@@ -409,7 +411,13 @@ mod tests {
.as_array()
.expect("items")
.iter()
.any(|item| item["title"] == "本地页面.md"));
.any(|item| item["title"] == "本地页面"
&& item["rowKind"] == "folder"
&& item["documentId"]
.as_str()
.unwrap_or("")
.starts_with("local-md:")
&& item["resourceMeta"]["extra"]["source"]["relativePath"] == "本地页面"));
let _ = std::fs::remove_dir_all(&root);
}