// 同一xx设置同时只可以操作8个并发的限制
if (xxx) {
String prefix = sipAccountInfo.getSipAccount();
String str = prefix.substring(0, prefix.indexOf("_"));
String today = MyDateUtils.formatLocalDateTime(LocalDateTime.now());
String concurrencyCalledCountKey = RedisKeyCenter.getConcurrencyCalledCountByGatewayKey(str, today);
Long result;
result = redisService.incrementKey(concurrencyCalledCountKey, 1);
result = result == null ? 0 : result;
if (result == 1) {
redisService.expire(concurrencyCalledCountKey, 1, TimeUnit.MINUTES);
}
while (result >= 8) {
logger.debug());
Thread.sleep(1000);
String newTime = MyDateUtils.formatLocalDateTime(LocalDateTime.now());
String countKey = RedisKeyCenter.getConcurrencyCalledCountByGatewayKey(str, newTime);
result = redisService.incrementKey(countKey, 1);
result = result == null ? 0 : result;
if (result == 1) {
redisService.expire(countKey, 1, TimeUnit.MINUTES);
}
}
}