update web

This commit is contained in:
2026-07-28 14:03:56 +07:00
parent a8bdd49072
commit 3a95456917
15 changed files with 575 additions and 171 deletions

View File

@@ -1,5 +1,5 @@
use std::cell::RefCell;
use std::collections::{HashMap, HashSet};
use std::sync::RwLock;
use std::time::Duration;
use anyhow::{Error, anyhow};
@@ -35,7 +35,7 @@ pub struct PersonRegistry {
persons: HashMap<PublicKey, Entity<Person>>,
/// Set of public keys that have been seen
seen: RefCell<HashSet<PublicKey>>,
seen: RwLock<HashSet<PublicKey>>,
/// Sender for requesting metadata
sender: flume::Sender<PublicKey>,
@@ -102,7 +102,7 @@ impl PersonRegistry {
Self {
persons: HashMap::new(),
seen: RefCell::new(HashSet::new()),
seen: RwLock::new(HashSet::new()),
sender: metadata_tx,
tasks,
}
@@ -280,7 +280,7 @@ impl PersonRegistry {
let public_key = *public_key;
if self.seen.borrow_mut().insert(public_key) {
if self.seen.write().unwrap().insert(public_key) {
let sender = self.sender.clone();
// Spawn background task to request metadata