MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / touch_with_bytes

Method touch_with_bytes

nodedb/src/control/security/sessions/registry.rs:254–262  ·  view source on GitHub ↗

Update last-active timestamp and increment byte counters.

(&self, session_id: &str, bytes_in_delta: u64, bytes_out_delta: u64)

Source from the content-addressed store, hash-verified

252
253 /// Update last-active timestamp and increment byte counters.
254 pub fn touch_with_bytes(&self, session_id: &str, bytes_in_delta: u64, bytes_out_delta: u64) {
255 let now = now_secs();
256 let sessions = self.sessions.read().unwrap_or_else(|p| p.into_inner());
257 if let Some(s) = sessions.get(session_id) {
258 s.last_active.store(now, Ordering::Relaxed);
259 s.bytes_in.fetch_add(bytes_in_delta, Ordering::Relaxed);
260 s.bytes_out.fetch_add(bytes_out_delta, Ordering::Relaxed);
261 }
262 }
263
264 /// Set the current statement digest for a session.
265 pub fn set_current_statement(&self, session_id: &str, digest: String) {

Callers

nothing calls this directly

Calls 4

now_secsFunction · 0.50
readMethod · 0.45
getMethod · 0.45
storeMethod · 0.45

Tested by

no test coverage detected