重复插入问题修复

This commit is contained in:
张松
2025-03-01 15:16:37 +08:00
parent 23247138e1
commit f092995e02
2 changed files with 20 additions and 13 deletions

View File

@@ -176,7 +176,7 @@ public class ApiAccessLimitUtil {
boolean lock = Boolean.TRUE.equals(redisUtils.setIfAbsent(lockKey, clientId, seconds));
int count = 0;
while (!lock) {
if (count++ > 100) {
if (count++ > 1000) {
throw new RuntimeException("系统繁忙, 稍后再试");
}
Thread.sleep(20);