Skip to content

Commit

Permalink
pool: removed unnecessary timeout during the shutdown notification pr…
Browse files Browse the repository at this point in the history
…ocess

Signed-off-by: Yuki Kishimoto <[email protected]>
  • Loading branch information
yukibtc committed Oct 28, 2024
1 parent 382db0f commit 282fbc3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<Event>` in fetch and query methods ([Yuki Kishimoto])
* sdk: rename `stream_events_of` to `stream_events` ([Yuki Kishimoto])
Expand Down
11 changes: 4 additions & 7 deletions crates/nostr-relay-pool/src/pool/inner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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");

Expand Down

0 comments on commit 282fbc3

Please sign in to comment.