MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / setSpurPrivacyCache

Function setSpurPrivacyCache

web/src/server/free-mode-country.ts:266–280  ·  view source on GitHub ↗
(
  ip: string,
  privacy: FreeModeIpPrivacy | null,
)

Source from the content-addressed store, hash-verified

264}
265
266function setSpurPrivacyCache(
267 ip: string,
268 privacy: FreeModeIpPrivacy | null,
269): void {
270 while (spurPrivacyCache.size >= IPINFO_PRIVACY_CACHE_MAX_ENTRIES) {
271 const oldestIp = spurPrivacyCache.keys().next().value
272 if (!oldestIp) break
273 spurPrivacyCache.delete(oldestIp)
274 }
275
276 spurPrivacyCache.set(ip, {
277 expiresAt: Date.now() + IPINFO_PRIVACY_CACHE_TTL_MS,
278 privacy,
279 })
280}
281
282function privacySignalsFromIpinfo(
283 data: Record<string, unknown>,

Callers 1

lookupSpurIpPrivacyFunction · 0.85

Calls 2

deleteMethod · 0.80
setMethod · 0.80

Tested by

no test coverage detected