Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/whitenoise/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,7 @@ impl Whitenoise {
Self::start_event_processing_loop(whitenoise_ref, event_receiver, shutdown_receiver).await;

// Fetch events and setup subscriptions after event processing has started
Self::setup_global_users_subscriptions(whitenoise_ref).await?;
Self::setup_accounts_sync_and_subscriptions(whitenoise_ref).await?;
Self::setup_all_subscriptions(whitenoise_ref).await?;

tracing::debug!(
target: "whitenoise::initialize_whitenoise",
Expand All @@ -224,6 +223,12 @@ impl Whitenoise {
Ok(())
}

pub async fn setup_all_subscriptions(whitenoise_ref: &'static Whitenoise) -> Result<()> {
Self::setup_global_users_subscriptions(whitenoise_ref).await?;
Self::setup_accounts_sync_and_subscriptions(whitenoise_ref).await?;
Ok(())
}

async fn setup_global_users_subscriptions(whitenoise_ref: &'static Whitenoise) -> Result<()> {
let users_with_relays = User::all_users_with_relay_urls(whitenoise_ref).await?;
let default_relays: Vec<RelayUrl> =
Expand Down