MCPcopy Create free account
hub / github.com/vastsa/FileCodeBox / check_ip

Method check_ip

apps/base/dependencies.py:74–81  ·  view source on GitHub ↗
(self, ip: str)

Source from the content-addressed store, hash-verified

72 self.minutes = minutes
73
74 def check_ip(self, ip: str) -> bool:
75 if ip in self.ips:
76 ip_info = self.ips[ip]
77 if ip_info["count"] >= self.count:
78 if ip_info["time"] + timedelta(minutes=self.minutes) > datetime.now():
79 return False
80 self.ips.pop(ip)
81 return True
82
83 def add_ip(self, ip: str) -> int:
84 ip_info = self.ips.get(ip, {"count": 0, "time": datetime.now()})

Callers 1

__call__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected