refactor(接口测试): 最后一个节点的重试机制影响性能优化

This commit is contained in:
fit2-zhao 2024-11-05 18:33:16 +08:00 committed by Craftsman
parent 93de335024
commit 46bc579966
1 changed files with 0 additions and 15 deletions

View File

@ -55,21 +55,6 @@ public class ApiExecutionQueueService {
String queueKey = QUEUE_DETAIL_PREFIX + queueId;
ListOperations<String, String> listOps = stringRedisTemplate.opsForList();
String queueDetail = listOps.leftPop(queueKey);
if (StringUtils.isBlank(queueDetail)) {
// 重试3次获取
for (int i = 0; i < 3; i++) {
queueDetail = stringRedisTemplate.opsForList().leftPop(queueKey);
if (StringUtils.isNotBlank(queueDetail)) {
break;
}
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
}
if (StringUtils.isNotBlank(queueDetail)) {
Long size = size(queueId);
if (size == null || size == 0) {