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

Method rotate_window_if_needed

nodedb/src/control/security/observability.rs:143–150  ·  view source on GitHub ↗

Rotate the 1-minute anomaly detection window if expired.

(&self)

Source from the content-addressed store, hash-verified

141
142 /// Rotate the 1-minute anomaly detection window if expired.
143 fn rotate_window_if_needed(&self) {
144 let now = now_secs();
145 let start = self.window_start_secs.load(Ordering::Relaxed);
146 if now - start >= 60 {
147 self.window_start_secs.store(now, Ordering::Relaxed);
148 self.failed_login_window.store(0, Ordering::Relaxed);
149 }
150 }
151
152 /// Open the JWKS circuit breaker (JWKS unreachable + cache expired).
153 pub fn open_jwks_circuit(&self) {

Callers 2

record_auth_failureMethod · 0.80
failed_login_spikeMethod · 0.80

Calls 3

now_secsFunction · 0.70
loadMethod · 0.45
storeMethod · 0.45

Tested by

no test coverage detected