refactoring: remove dependency on SimpleFiles, make tree parsing multithreaded
This commit is contained in:
parent
505163383f
commit
0713b59063
11 changed files with 283 additions and 177 deletions
|
@ -144,13 +144,12 @@ async fn branch(RawQuery(named_id): RawQuery, State(state): State<Arc<Server>>)
|
|||
});
|
||||
if let Some(branch_id) = branch_id {
|
||||
let branch = state.sources.treehouse.tree.branch(branch_id);
|
||||
if let Source::Tree {
|
||||
input, target_path, ..
|
||||
} = state.sources.treehouse.source(branch.file_id)
|
||||
if let Source::Tree { input, tree_path } =
|
||||
state.sources.treehouse.source(branch.file_id)
|
||||
{
|
||||
if let Some(content) = state
|
||||
.target
|
||||
.content(target_path)
|
||||
.content(tree_path)
|
||||
.await
|
||||
.and_then(|s| String::from_utf8(s).ok())
|
||||
{
|
||||
|
@ -172,7 +171,7 @@ async fn branch(RawQuery(named_id): RawQuery, State(state): State<Arc<Server>>)
|
|||
} else {
|
||||
return (
|
||||
StatusCode::INTERNAL_SERVER_ERROR,
|
||||
format!("500 Internal Server Error: branch metadata points to entry {target_path} which does not have readable content")
|
||||
format!("500 Internal Server Error: branch metadata points to entry {tree_path} which does not have readable content")
|
||||
)
|
||||
.into_response();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue