MCPcopy Index your code
hub / github.com/vastsa/FileCodeBox / remove_expired_ip

Method remove_expired_ip

apps/base/dependencies.py:90–97  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

88 return ip_info["count"]
89
90 async def remove_expired_ip(self) -> None:
91 now = datetime.now()
92 expiration = timedelta(minutes=self.minutes)
93 self.ips = {
94 ip: info
95 for ip, info in self.ips.items()
96 if info["time"] + expiration >= now
97 }
98
99 def __call__(self, request: Request) -> str:
100 ip = get_client_ip(request)

Callers 1

delete_expire_filesFunction · 0.80

Calls 1

itemsMethod · 0.80

Tested by

no test coverage detected