refactor: drop postgres leftovers, narrow bootstrap api

This commit is contained in:
2026-10-25 23:25:16 +01:00
parent ec2760fd48
commit b7e69b69dc
16 changed files with 277 additions and 58 deletions

View File

@@ -38,18 +38,18 @@ pub struct SqliteEventQueue {
}
impl SqliteEventQueue {
pub async fn create(pool: SqlitePool, config: DbEventQueueConfig) -> anyhow::Result<Self> {
Ok(Self {
pub fn create(pool: SqlitePool, config: DbEventQueueConfig) -> Self {
Self {
pool,
config: Arc::new(config),
})
}
}
pub async fn create_publisher(
pool: SqlitePool,
config: &config::EventsConfig,
) -> anyhow::Result<Arc<dyn EventPublisher>> {
let q = Self::create(pool, DbEventQueueConfig::from_config(config)).await?;
let q = Self::create(pool, DbEventQueueConfig::from_config(config));
Ok(Arc::new(q))
}
@@ -57,7 +57,7 @@ impl SqliteEventQueue {
pool: SqlitePool,
config: &config::EventsConfig,
) -> anyhow::Result<(Arc<dyn EventPublisher>, Arc<dyn EventConsumer>)> {
let q = Self::create(pool, DbEventQueueConfig::from_config(config)).await?;
let q = Self::create(pool, DbEventQueueConfig::from_config(config));
Ok((Arc::new(q.clone()), Arc::new(q)))
}
}