refactor: drop postgres leftovers, narrow bootstrap api
This commit is contained in:
@@ -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)))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user