MCPcopy Create free account
hub / github.com/dedsec1121fk/DedSec / parse_dt

Function parse_dt

Scripts/ButSystem.py:10521–10535  ·  view source on GitHub ↗
(p: str)

Source from the content-addressed store, hash-verified

10519_action_lock = threading.Lock()
10520
10521def _rl_key(bucket: str, ident: str) -> str:
10522 return f"{bucket}:{ident or '?'}"
10523
10524def _rate_limit_hit(bucket: str, ident: str, limit: int, window_sec: int) -> bool:
10525 """Sliding-window rate limiter stored in memory for this process.
10526
10527Used for abusive login / signup / recovery / admin bursts.
10528"""
10529 now = time.time()
10530 key = _rl_key(bucket, ident)
10531 with _action_lock:
10532 hits = [t for t in _action_hits.get(key, []) if (now - t) <= window_sec]
10533 if len(hits) >= limit:
10534 _action_hits[key] = hits
10535 return True
10536 hits.append(now)
10537 _action_hits[key] = hits
10538 return False

Callers 1

_fetch_news_uncachedFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected