From 282fbc39373674b7394806d47311a8e483da0ef0 Mon Sep 17 00:00:00 2001 From: Yuki Kishimoto Date: Mon, 28 Oct 2024 08:51:38 +0100 Subject: [PATCH] pool: removed unnecessary timeout during the shutdown notification process Signed-off-by: Yuki Kishimoto --- CHANGELOG.md | 1 + crates/nostr-relay-pool/src/pool/inner.rs | 11 ++++------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c377f107..16f26dab7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,7 @@ * pool: rework relay connection methods and auto-connection logic ([Yuki Kishimoto]) * pool: increase `MAX_ADJ_RETRY_SEC` to 120 secs ([Yuki Kishimoto]) * pool: return reference instead of cloned structs for some getter methods of `Relay` ([Yuki Kishimoto]) +* pool: removed unnecessary timeout during the shutdown notification process ([Yuki Kishimoto]) * sdk: deprecate `Client::get_events_of` and `Client::get_events_from` methods ([Yuki Kishimoto]) * sdk: use `Events` instead of `Vec` in fetch and query methods ([Yuki Kishimoto]) * sdk: rename `stream_events_of` to `stream_events` ([Yuki Kishimoto]) diff --git a/crates/nostr-relay-pool/src/pool/inner.rs b/crates/nostr-relay-pool/src/pool/inner.rs index 97f2505a8..980a1f227 100644 --- a/crates/nostr-relay-pool/src/pool/inner.rs +++ b/crates/nostr-relay-pool/src/pool/inner.rs @@ -9,7 +9,7 @@ use std::sync::Arc; use std::time::Duration; use async_utility::futures_util::{future, StreamExt}; -use async_utility::{thread, time}; +use async_utility::thread; use atomic_destructor::AtomicDestroyer; use nostr::prelude::*; use nostr_database::{DynNostrDatabase, Events, IntoNostrDatabase}; @@ -71,12 +71,9 @@ impl InnerRelayPool { self.disconnect().await?; // Send shutdown notification - time::timeout(Some(Duration::from_secs(1)), async move { - let _ = self - .notification_sender - .send(RelayPoolNotification::Shutdown); - }) - .await; + let _ = self + .notification_sender + .send(RelayPoolNotification::Shutdown); tracing::info!("Relay pool shutdown");