Skip to content

Commit e70462b

Browse files
authored
feat(whitenoise/mod): expose setup_all_subscriptions method publicly (#352)
1 parent fe2891b commit e70462b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/whitenoise/mod.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,7 @@ impl Whitenoise {
213213
Self::start_event_processing_loop(whitenoise_ref, event_receiver, shutdown_receiver).await;
214214

215215
// Fetch events and setup subscriptions after event processing has started
216-
Self::setup_global_users_subscriptions(whitenoise_ref).await?;
217-
Self::setup_accounts_sync_and_subscriptions(whitenoise_ref).await?;
216+
Self::setup_all_subscriptions(whitenoise_ref).await?;
218217

219218
tracing::debug!(
220219
target: "whitenoise::initialize_whitenoise",
@@ -224,6 +223,12 @@ impl Whitenoise {
224223
Ok(())
225224
}
226225

226+
pub async fn setup_all_subscriptions(whitenoise_ref: &'static Whitenoise) -> Result<()> {
227+
Self::setup_global_users_subscriptions(whitenoise_ref).await?;
228+
Self::setup_accounts_sync_and_subscriptions(whitenoise_ref).await?;
229+
Ok(())
230+
}
231+
227232
async fn setup_global_users_subscriptions(whitenoise_ref: &'static Whitenoise) -> Result<()> {
228233
let users_with_relays = User::all_users_with_relay_urls(whitenoise_ref).await?;
229234
let default_relays: Vec<RelayUrl> =

0 commit comments

Comments
 (0)