Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
iambriccardo committed Aug 13, 2024
1 parent 748c6ca commit 8ab9e49
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion relay-server/src/services/buffer/envelope_store/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ pub trait EnvelopeStore {
limit: i64,
) -> impl Future<Output = Result<Vec<Box<Envelope>>, Self::Error>>;

#[allow(dead_code)]
/// Returns a set of project key pairs, representing all the unique combinations of
/// `own_key` and `project_key` that are found in the store.
#[allow(dead_code)]
fn project_key_pairs(
&self,
) -> impl Future<Output = Result<HashSet<(ProjectKey, ProjectKey)>, Self::Error>>;
Expand Down
11 changes: 9 additions & 2 deletions relay-server/src/services/buffer/envelope_store/sqlite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -562,8 +562,15 @@ mod tests {
#[tokio::test]
async fn test_estimate_disk_usage() {
let db = setup_db(true).await;
let mut envelope_store = SqliteEnvelopeStore::new(db);
let mut store = SqliteEnvelopeStore::new(db.clone());

let envelopes = mock_envelopes(10);
store
.insert_many(envelopes.iter().map(|e| e.as_ref().try_into().unwrap()))
.await
.unwrap();

println!("{:?}", envelope_store.usage());
let usage = SqliteEnvelopeStore::estimate_usage(&db).await.unwrap();
assert!(usage > 0);
}
}

0 comments on commit 8ab9e49

Please sign in to comment.