feat(worker): handle FetchActorConnections — resolve and cache remote actor connections
This commit is contained in:
@@ -6,6 +6,7 @@ use activitypub_base::ActivityPubService;
|
||||
use application::services::{FederationEventService, NotificationEventService};
|
||||
use domain::ports::{ActivityPubRepository, FederationActionPort, OutboundFederationPort};
|
||||
use postgres::activitypub::PgActivityPubRepository;
|
||||
use postgres::remote_actor_connections::PgRemoteActorConnectionRepository;
|
||||
use postgres_federation::{PostgresApUserRepository, PostgresFederationRepository};
|
||||
|
||||
use crate::handlers::{FederationHandler, NotificationHandler};
|
||||
@@ -59,6 +60,8 @@ pub async fn build(
|
||||
let ap_federation = ap_service.clone() as Arc<dyn FederationActionPort>;
|
||||
let ap_repo_worker =
|
||||
Arc::new(PgActivityPubRepository::new(pool.clone())) as Arc<dyn ActivityPubRepository>;
|
||||
let actor_connections = Arc::new(PgRemoteActorConnectionRepository::new(pool.clone()))
|
||||
as Arc<dyn domain::ports::RemoteActorConnectionRepository>;
|
||||
|
||||
// Application services
|
||||
let notification_svc = Arc::new(NotificationEventService {
|
||||
@@ -72,6 +75,7 @@ pub async fn build(
|
||||
base_url: base_url.to_string(),
|
||||
federation_action: ap_federation,
|
||||
ap_repo: ap_repo_worker,
|
||||
remote_actor_connections: actor_connections,
|
||||
});
|
||||
|
||||
// Thin handlers
|
||||
|
||||
Reference in New Issue
Block a user