MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / _rate_limit

Function _rate_limit

deploy/sbom/resolve_licenses.py:209–217  ·  view source on GitHub ↗
(domain: str, interval: float = 0.15)

Source from the content-addressed store, hash-verified

207
208
209def _rate_limit(domain: str, interval: float = 0.15) -> None:
210 with _rate_lock:
211 now = time.monotonic()
212 last = _last_request.get(domain, 0.0)
213 next_req = max(now, last + interval)
214 _last_request[domain] = next_req
215 wait = next_req - now
216 if wait > 0:
217 time.sleep(wait)
218
219
220def _get_json(url: str, domain: str) -> dict | None:

Callers 4

callFunction · 0.90
call_alphaFunction · 0.90
_get_jsonFunction · 0.85

Calls 1

getMethod · 0.45

Tested by 3

callFunction · 0.72
call_alphaFunction · 0.72