Skip to content

Commit

Permalink
Merge pull request #678 from Hou-Xiaoxuan/fix-libra-p2p
Browse files Browse the repository at this point in the history
fix `Libra` p2p download: path error
  • Loading branch information
genedna authored Nov 9, 2024
2 parents 9fedcc4 + 1d91262 commit 0064033
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 1 addition & 2 deletions common/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,8 @@ impl From<sea_orm::DbErr> for MegaError {
}

#[derive(Error, Debug)]
#[allow(unused)]
pub enum GitLFSError {
#[error("Something went wrong in Git LFS")]
#[error("Something went wrong in Git LFS: {0}")]
GeneralError(String),
}

Expand Down
3 changes: 3 additions & 0 deletions libra/src/internal/protocol/lfs_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,9 @@ impl LFSClient {
// infer that all chunks share same size! (except last one)
let chunk_size = chunks.first().unwrap().size as usize;
let mut checksum = Context::new(&SHA256);
if let Some(parent) = path.as_ref().parent() {
tokio::fs::create_dir_all(parent).await?;
}
let mut file = tokio::fs::File::create(path).await?;
for (i, chunk) in chunks.iter().enumerate() { // TODO parallel download
println!("- part: {}/{}", i + 1, chunks.len());
Expand Down

1 comment on commit 0064033

@vercel
Copy link

@vercel vercel bot commented on 0064033 Nov 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

mega – ./

www.gitmega.dev
mega-gitmono.vercel.app
mega-git-main-gitmono.vercel.app
gitmega.dev

Please sign in to comment.