Skip to content

Commit

Permalink
no need to instrument DBs
Browse files Browse the repository at this point in the history
also did an update to bfsp that should remove a ton of unnecessary deps
  • Loading branch information
billyb2 committed Aug 30, 2024
1 parent 9c72473 commit 0b4a307
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 213 deletions.
207 changes: 3 additions & 204 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ pub async fn handle_message<M: MetaDB + 'static, C: ChunkDB + 'static>(
.prepend_len())
}

#[tracing::instrument(err, skip(token))]
#[tracing::instrument(err, skip(token, meta_db, chunk_db))]
pub async fn handle_download_chunk<M: MetaDB, C: ChunkDB>(
meta_db: &M,
chunk_db: &C,
Expand Down Expand Up @@ -526,7 +526,7 @@ pub async fn handle_download_chunk<M: MetaDB, C: ChunkDB>(
}

// FIXME: very ddosable by querying many chunks at once
#[tracing::instrument(err, skip(token))]
#[tracing::instrument(err, skip(token, meta_db))]
async fn query_chunks_uploaded<M: MetaDB>(
meta_db: &M,
token: &Biscuit,
Expand All @@ -552,7 +552,7 @@ async fn query_chunks_uploaded<M: MetaDB>(
}

// TODO: Maybe store upload_chunk messages in files and mmap them?
#[tracing::instrument(err, skip(chunk, token))]
#[tracing::instrument(err, skip(chunk, token, meta_db, enc_chunk_metadata))]
async fn handle_upload_chunk<M: MetaDB + 'static, C: ChunkDB + 'static>(
meta_db: Arc<M>,
chunk_db: Arc<C>,
Expand Down Expand Up @@ -604,7 +604,7 @@ async fn handle_upload_chunk<M: MetaDB + 'static, C: ChunkDB + 'static>(
Ok(())
}

#[tracing::instrument(err, skip(token))]
#[tracing::instrument(err, skip(token, meta_db, chunk_db))]
pub async fn handle_delete_chunks<D: MetaDB, C: ChunkDB>(
meta_db: &D,
chunk_db: &C,
Expand Down Expand Up @@ -642,7 +642,7 @@ impl Display for UploadMetadataError {
}
}

#[tracing::instrument(err, skip(token))]
#[tracing::instrument(err, skip(token, meta_db, enc_file_meta))]
pub async fn handle_upload_file_metadata<D: MetaDB>(
meta_db: &D,
token: &Biscuit,
Expand Down Expand Up @@ -670,7 +670,7 @@ pub async fn handle_upload_file_metadata<D: MetaDB>(
Ok(())
}

#[tracing::instrument(err, skip(token))]
#[tracing::instrument(err, skip(token, meta_db))]
pub async fn handle_download_file_metadata<D: MetaDB>(
meta_db: &D,
token: &Biscuit,
Expand All @@ -686,7 +686,7 @@ pub async fn handle_download_file_metadata<D: MetaDB>(
}
}

#[tracing::instrument(err, skip(token))]
#[tracing::instrument(err, skip(token, meta_db))]
pub async fn handle_list_file_metadata<D: MetaDB>(
meta_db: &D,
token: &Biscuit,
Expand Down Expand Up @@ -715,7 +715,7 @@ pub async fn handle_list_chunk_metadata<D: MetaDB>(
Ok(meta)
}

#[tracing::instrument(err, skip(token))]
#[tracing::instrument(err, skip(token, meta_db))]
pub async fn handle_delete_file_metadata<D: MetaDB>(
meta_db: &D,
token: &Biscuit,
Expand All @@ -730,7 +730,7 @@ pub async fn handle_delete_file_metadata<D: MetaDB>(
Ok(())
}

#[tracing::instrument(err, skip(token))]
#[tracing::instrument(err, skip(token, meta_db))]
pub async fn handle_get_usage<D: MetaDB>(meta_db: &D, token: &Biscuit) -> anyhow::Result<u64> {
let user_id = authorize(Right::Usage, token, Vec::new(), meta_db)
.await
Expand Down

0 comments on commit 0b4a307

Please sign in to comment.