ip 请求次数限制17
This commit is contained in:
parent
0488c84143
commit
da9db2f8b1
|
|
@ -65,6 +65,9 @@ public class IpAccessCounter {
|
|||
Set<String> removedIps = new HashSet<>();
|
||||
for (Map.Entry<String, List<Long>> entry : IP_ACCESS_TIMES.entrySet()) {
|
||||
List<Long> accessTimes = entry.getValue();
|
||||
if (accessTimes == null || accessTimes.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
accessTimes.removeIf(time -> currentTime - time > ONE_MINUTE);
|
||||
if (accessTimes.isEmpty()) {
|
||||
removedIps.add(entry.getKey());
|
||||
|
|
|
|||
Loading…
Reference in New Issue