fix():解决报错

version-2():解决迭代器报空异常
master
Saisai Liu 2024-06-02 10:20:17 +08:00
parent abfc6d8a91
commit 23cc7f44be
1 changed files with 2 additions and 1 deletions

View File

@ -52,7 +52,7 @@ public class SelectInstances {
}
// @Scheduled(cron = "0 0/10 * * * ? ")
@Scheduled(cron = "0/10 * * * * ? ")
@Scheduled(cron = "0 0/10 * * * ? ")
public void saveIps() throws Exception {
List<String> ips = new ArrayList<>();
com.aliyun.ecs20140526.Client client = SelectInstances.createClient();
@ -160,6 +160,7 @@ public class SelectInstances {
int i1 = map.get(ip) - 1;
map.put(ip, i1);
if (i1 == 0) {
iterator.remove();
map.remove(ip);
}
}