From 753fddea9b011868f7fa175c702564dfa6b4aae1 Mon Sep 17 00:00:00 2001 From: Nazar Mokrynskyi Date: Tue, 31 Oct 2023 19:39:17 +0200 Subject: [PATCH] Drain notifications after DSN sync --- crates/subspace-service/src/sync_from_dsn.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/subspace-service/src/sync_from_dsn.rs b/crates/subspace-service/src/sync_from_dsn.rs index 362633c151..c9ff69282a 100644 --- a/crates/subspace-service/src/sync_from_dsn.rs +++ b/crates/subspace-service/src/sync_from_dsn.rs @@ -256,10 +256,6 @@ where while let Some(reason) = notifications.next().await { let prev_sync_mode = sync_mode.swap(SyncMode::Paused, Ordering::AcqRel); - while notifications.try_next().is_ok() { - // Just drain extra messages if there are any - } - info!(?reason, "Received notification to sync from DSN"); // TODO: Maybe handle failed block imports, additional helpful logging if let Err(error) = import_blocks_from_dsn( @@ -280,6 +276,10 @@ where initial_sync_mode.take().unwrap_or(prev_sync_mode), Ordering::Release, ); + + while notifications.try_next().is_ok() { + // Just drain extra messages if there are any + } } Ok(())