mirror of
https://github.com/vastsa/FileCodeBox.git
synced 2026-11-22 06:57:56 +08:00
update:增强iplimit
This commit is contained in:
1 parent
3864335fca
commit
de1096acc4
1 file changed
+1
@@ -36,6 +36,7 @@ class IPRateLimit:
|
||||
def add_ip(self, ip):
|
||||
ip_info = self.ips.get(ip, {'count': 0, 'time': datetime.now()})
|
||||
ip_info['count'] += 1
|
||||
ip_info['time'] = datetime.now()
|
||||
self.ips[ip] = ip_info
|
||||
return ip_info['count']
|
||||
|
||||
|
||||
Reference in new issue
Block a user