diff --git a/relay-server/src/services/buffer/envelope_buffer/mod.rs b/relay-server/src/services/buffer/envelope_buffer/mod.rs index 8843ac3730..ad2d65e772 100644 --- a/relay-server/src/services/buffer/envelope_buffer/mod.rs +++ b/relay-server/src/services/buffer/envelope_buffer/mod.rs @@ -72,7 +72,10 @@ impl EnvelopesBuffer { #[derive(Debug)] struct InnerEnvelopesBuffer { /// The central priority queue. - priority_queue: priority_queue::PriorityQueue, Priority>, + priority_queue: priority_queue::PriorityQueue< + QueueItem::Provider as StackProvider>::Stack>, + Priority, + >, /// A lookup table to find all stacks involving a project. stacks_by_project: hashbrown::HashMap>, stack_provider: S::Provider, diff --git a/relay-server/src/services/buffer/envelope_stack/mod.rs b/relay-server/src/services/buffer/envelope_stack/mod.rs index 574b5e0bd3..fb8b1114a2 100644 --- a/relay-server/src/services/buffer/envelope_stack/mod.rs +++ b/relay-server/src/services/buffer/envelope_stack/mod.rs @@ -6,7 +6,7 @@ pub mod memory; pub mod sqlite; /// A stack-like data structure that holds [`Envelope`]s. -pub trait EnvelopeStack: Send { +pub trait EnvelopeStack: Send + std::fmt::Debug { /// The error type that is returned when an error is encountered during reading or writing the /// [`EnvelopeStack`]. type Error: std::fmt::Debug; @@ -27,7 +27,7 @@ pub trait EnvelopeStack: Send { fn pop(&mut self) -> impl Future>, Self::Error>>; } -pub trait StackProvider { +pub trait StackProvider: std::fmt::Debug { type Stack: EnvelopeStack; fn create_stack(&self, envelope: Box) -> Self::Stack; diff --git a/relay-server/src/services/buffer/envelope_stack/sqlite.rs b/relay-server/src/services/buffer/envelope_stack/sqlite.rs index 894ea5f9fc..ecfd1213ad 100644 --- a/relay-server/src/services/buffer/envelope_stack/sqlite.rs +++ b/relay-server/src/services/buffer/envelope_stack/sqlite.rs @@ -1,18 +1,11 @@ use std::collections::VecDeque; -use std::error::Error; use std::fmt::Debug; use std::num::NonZeroUsize; -use std::path::Path; - -use futures::StreamExt; -use sqlx::sqlite::{SqliteConnectOptions, SqliteJournalMode, SqlitePoolOptions}; -use sqlx::{Pool, Row, Sqlite}; -use tokio::fs::DirBuilder; use relay_base_schema::project::ProjectKey; use crate::envelope::Envelope; -use crate::services::buffer::envelope_stack::{EnvelopeStack, StackProvider}; +use crate::services::buffer::envelope_stack::EnvelopeStack; use crate::services::buffer::sqlite_envelope_store::SqliteEnvelopeStore; use crate::services::buffer::stack_provider::sqlite::SqliteStackProvider; diff --git a/relay-server/src/services/buffer/sqlite_envelope_store.rs b/relay-server/src/services/buffer/sqlite_envelope_store.rs index 62a8a6a6b8..0fe7a6c0ae 100644 --- a/relay-server/src/services/buffer/sqlite_envelope_store.rs +++ b/relay-server/src/services/buffer/sqlite_envelope_store.rs @@ -20,7 +20,7 @@ use crate::extractors::StartTime; use crate::services::buffer::envelope_stack::sqlite::SqliteEnvelopeStackError; use crate::Envelope; -struct InsertEnvelope { +pub struct InsertEnvelope { received_at: i64, own_key: ProjectKey, sampling_key: ProjectKey,