bug fixing and deploy and build diagnostics
This commit is contained in:
@@ -19,13 +19,6 @@ pub struct DhtDidCache {
|
||||
}
|
||||
|
||||
impl DhtDidCache {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
entries: RwLock::new(HashMap::new()),
|
||||
ttl: std::time::Duration::from_secs(3600),
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn get(&self, did: &str) -> Option<serde_json::Value> {
|
||||
let entries = self.entries.read().await;
|
||||
if let Some((ts, doc)) = entries.get(did) {
|
||||
|
||||
@@ -281,20 +281,3 @@ async fn sync_single_peer(
|
||||
Ok(imported)
|
||||
}
|
||||
|
||||
/// Add a peer as a sync target.
|
||||
pub async fn add_sync_target(data_dir: &Path, onion: &str) -> Result<()> {
|
||||
let mut state = load_sync_state(data_dir).await?;
|
||||
if !state.peer_sync_targets.contains(&onion.to_string()) {
|
||||
state.peer_sync_targets.push(onion.to_string());
|
||||
save_sync_state(data_dir, &state).await?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Remove a peer sync target.
|
||||
pub async fn remove_sync_target(data_dir: &Path, onion: &str) -> Result<()> {
|
||||
let mut state = load_sync_state(data_dir).await?;
|
||||
state.peer_sync_targets.retain(|o| o != onion);
|
||||
save_sync_state(data_dir, &state).await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user