bug fixing and deploy and build diagnostics

This commit is contained in:
Dorian
2026-03-22 03:30:21 +00:00
parent 1f8287c4c3
commit e4e0ef4f11
198 changed files with 21703 additions and 19587 deletions

View File

@@ -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) {

View File

@@ -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(())
}