优化Catalog接收,提升大量设备同时接入性能
This commit is contained in:
@@ -37,7 +37,6 @@ import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
* @author lin
|
||||
@@ -470,6 +469,7 @@ public class DeviceChannelServiceImpl implements IDeviceChannelService {
|
||||
if (CollectionUtils.isEmpty(deviceChannelList)) {
|
||||
return false;
|
||||
}
|
||||
System.out.println("size: " + deviceChannelList.size());
|
||||
List<DeviceChannel> allChannels = channelMapper.queryAllChannelsForRefresh(deviceDbId);
|
||||
Map<String,DeviceChannel> allChannelMap = new HashMap<>();
|
||||
if (!allChannels.isEmpty()) {
|
||||
|
||||
@@ -335,12 +335,12 @@ public class DeviceServiceImpl implements IDeviceService {
|
||||
try {
|
||||
sipCommander.catalogQuery(device, sn, event -> {
|
||||
String errorMsg = String.format("同步通道失败,错误码: %s, %s", event.statusCode, event.msg);
|
||||
catalogResponseMessageHandler.setChannelSyncEnd(device.getDeviceId(), errorMsg);
|
||||
catalogResponseMessageHandler.setChannelSyncEnd(device.getDeviceId(), sn, errorMsg);
|
||||
});
|
||||
} catch (SipException | InvalidArgumentException | ParseException e) {
|
||||
log.error("[同步通道], 信令发送失败:{}", e.getMessage() );
|
||||
String errorMsg = String.format("同步通道失败,信令发送失败: %s", e.getMessage());
|
||||
catalogResponseMessageHandler.setChannelSyncEnd(device.getDeviceId(), errorMsg);
|
||||
catalogResponseMessageHandler.setChannelSyncEnd(device.getDeviceId(), sn, errorMsg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user