Remove the giant lock from dht

This commit is contained in:
Igor Katson 2023-11-28 08:03:12 +00:00
parent eaf5021908
commit c7cf5eedef
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
6 changed files with 84 additions and 65 deletions

View file

@ -11,8 +11,8 @@ use std::time::Duration;
use anyhow::Context;
use tracing::{debug, error, error_span, info, trace, warn};
use crate::dht::{Dht, DhtConfig};
use crate::routing_table::RoutingTable;
use crate::{Dht, DhtConfig, DhtState};
#[derive(Default, Clone)]
pub struct PersistentDhtConfig {
@ -108,7 +108,7 @@ impl PersistentDht {
listen_addr,
..Default::default()
};
let dht = Dht::with_config(dht_config).await?;
let dht = DhtState::with_config(dht_config).await?;
spawn(error_span!("dht_persistence"), {
let dht = dht.clone();