mirror of
https://github.com/aljazceru/notedeck.git
synced 2026-01-22 17:54:20 +01:00
Skip adding relays that are already in the pool
This commit is contained in:
@@ -152,6 +152,10 @@ impl RelayPool {
|
||||
url: String,
|
||||
wakeup: impl Fn() + Send + Sync + Clone + 'static,
|
||||
) -> Result<()> {
|
||||
// Check if the URL already exists in the pool.
|
||||
if self.has(&url) {
|
||||
return Ok(());
|
||||
}
|
||||
let relay = Relay::new(url, wakeup)?;
|
||||
let pool_relay = PoolRelay::new(relay);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user