Update last-active timestamp (called at each request boundary).
(&self, session_id: &str)
| 243 | |
| 244 | /// Update last-active timestamp (called at each request boundary). |
| 245 | pub fn touch(&self, session_id: &str) { |
| 246 | let now = now_secs(); |
| 247 | let sessions = self.sessions.read().unwrap_or_else(|p| p.into_inner()); |
| 248 | if let Some(s) = sessions.get(session_id) { |
| 249 | s.last_active.store(now, Ordering::Relaxed); |
| 250 | } |
| 251 | } |
| 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) { |