Skip to content

Commit

Permalink
correctly handle "chunk already exists" error
Browse files Browse the repository at this point in the history
  • Loading branch information
billyb2 committed Sep 12, 2024
1 parent 4620ebb commit 973f46f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -596,10 +596,16 @@ async fn handle_upload_chunk<M: MetaDB + 'static, C: ChunkDB + 'static>(
.await
.unwrap();

meta_db
if let Err(err) = meta_db
.insert_enc_chunk_meta(enc_chunk_metadata, chunk.len().try_into().unwrap(), user_id)
.await
.unwrap();
{
match err {
// this error doesn't really matter
meta_db::InsertChunkError::AlreadyExists => (),
meta_db::InsertChunkError::DatabaseError(_) => return Err(err.into()),
}
}

Ok(())
}
Expand Down

0 comments on commit 973f46f

Please sign in to comment.