MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / update_peer_last_seen

Method update_peer_last_seen

gateway/src/kv/mod.rs:705–714  ·  view source on GitHub ↗
(&self, peer_id: NodeId)

Source from the content-addressed store, hash-verified

703 }
704
705 pub fn update_peer_last_seen(&self, peer_id: NodeId) {
706 let ts = std::time::SystemTime::now()
707 .duration_since(std::time::UNIX_EPOCH)
708 .map(|d| d.as_secs())
709 .unwrap_or(0);
710 let key = keys::last_seen_node(peer_id, self.my_node_id);
711 if let Err(e) = self.ephemeral.write().put_encoded(key, &ts) {
712 warn!("failed to update peer {peer_id} last_seen: {e}");
713 }
714 }
715
716 /// Get all peer addresses from DB (for debugging/testing)
717 pub fn get_all_peer_addrs(&self) -> BTreeMap<NodeId, String> {

Callers 1

sync_toMethod · 0.80

Calls 3

last_seen_nodeFunction · 0.85
put_encodedMethod · 0.80
writeMethod · 0.80

Tested by

no test coverage detected