diff --git a/crates/presentation/src/factory.rs b/crates/presentation/src/factory.rs index 822e340..9c4f671 100644 --- a/crates/presentation/src/factory.rs +++ b/crates/presentation/src/factory.rs @@ -31,6 +31,8 @@ pub struct DatabaseOutput { pub search_command: Arc, pub profile_fields: Arc, pub ap_content: Arc, + pub wrapup_stats: Arc, + pub wrapup_repo: Arc, pub db_pool: DbPool, } @@ -67,6 +69,8 @@ pub async fn build_database_adapters(backend: &str, url: &str) -> anyhow::Result search_command: sc, profile_fields: pf, ap_content: w.ap_content, + wrapup_stats: w.wrapup_stats, + wrapup_repo: w.wrapup_repo, db_pool: DbPool::Postgres(w.pool), }) } @@ -100,6 +104,8 @@ pub async fn build_database_adapters(backend: &str, url: &str) -> anyhow::Result search_command: sc, profile_fields: pf, ap_content: w.ap_content, + wrapup_stats: w.wrapup_stats, + wrapup_repo: w.wrapup_repo, db_pool: DbPool::Sqlite(w.pool), }) } diff --git a/crates/presentation/src/main.rs b/crates/presentation/src/main.rs index b52ada6..c5c6985 100644 --- a/crates/presentation/src/main.rs +++ b/crates/presentation/src/main.rs @@ -193,8 +193,8 @@ async fn wire_dependencies() -> anyhow::Result<(AppState, axum::Router)> { social_query: social_query.clone(), #[cfg(not(feature = "federation"))] social_query: Arc::new(domain::testing::NoopSocialQueryPort), - wrapup_stats: Arc::new(domain::testing::PanicWrapUpStatsQuery) as Arc, - wrapup_repo: Arc::new(domain::testing::PanicWrapUpRepository) as Arc, + wrapup_stats: db.wrapup_stats, + wrapup_repo: db.wrapup_repo, }, services: Services { auth: auth_service, diff --git a/crates/worker/src/db.rs b/crates/worker/src/db.rs index 6fb5793..648f07a 100644 --- a/crates/worker/src/db.rs +++ b/crates/worker/src/db.rs @@ -36,6 +36,8 @@ pub struct WorkerDbOutput { pub ap_content: Arc, pub image_ref_command: Arc, pub image_ref_query: Arc, + pub wrapup_stats: Arc, + pub wrapup_repo: Arc, pub db_pool: DbPool, } @@ -76,6 +78,8 @@ pub async fn connect(database_url: &str, backend: &str) -> anyhow::Result anyhow::Result anyhow::Result<()> { social_query: fed_social_query, #[cfg(not(feature = "federation"))] social_query: Arc::new(domain::testing::NoopSocialQueryPort), - wrapup_stats: Arc::new(domain::testing::PanicWrapUpStatsQuery) as Arc, - wrapup_repo: Arc::new(domain::testing::PanicWrapUpRepository) as Arc, + wrapup_stats: db.wrapup_stats, + wrapup_repo: db.wrapup_repo, }, services: Services { auth: auth_service,