Commit 76dedb11f8848fd138d494b74c9d5bd1d1de6fc8

Authored by 648540858
1 parent b957ab61

bug修复

src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java
... ... @@ -160,7 +160,7 @@ public class DeviceServiceImpl implements IDeviceService {
160 160 logger.info("[添加目录订阅] 设备{}", device.getDeviceId());
161 161 // 添加目录订阅
162 162 CatalogSubscribeTask catalogSubscribeTask = new CatalogSubscribeTask(device, sipCommander, dynamicTask);
163   - // 提前开始刷新订阅
  163 + // 刷新订阅
164 164 int subscribeCycleForCatalog = Math.max(device.getSubscribeCycleForCatalog(),30);
165 165 // 设置最小值为30
166 166 dynamicTask.startCron(device.getDeviceId() + "catalog", catalogSubscribeTask, (subscribeCycleForCatalog -1) * 1000);
... ... @@ -195,8 +195,8 @@ public class DeviceServiceImpl implements IDeviceService {
195 195 MobilePositionSubscribeTask mobilePositionSubscribeTask = new MobilePositionSubscribeTask(device, sipCommander, dynamicTask);
196 196 // 设置最小值为30
197 197 int subscribeCycleForCatalog = Math.max(device.getSubscribeCycleForMobilePosition(),30);
198   - // 提前开始刷新订阅
199   - dynamicTask.startCron(device.getDeviceId() + "mobile_position" , mobilePositionSubscribeTask, (subscribeCycleForCatalog -1 ) * 1000);
  198 + // 刷新订阅
  199 + dynamicTask.startCron(device.getDeviceId() + "mobile_position" , mobilePositionSubscribeTask, (subscribeCycleForCatalog) * 1000);
200 200 return true;
201 201 }
202 202  
... ...
src/main/java/com/genersoft/iot/vmp/service/impl/RedisPushStreamStatusMsgListener.java
... ... @@ -57,11 +57,16 @@ public class RedisPushStreamStatusMsgListener implements MessageListener, Applic
57 57  
58 58 @Override
59 59 public void onMessage(Message message, byte[] bytes) {
  60 + // TODO 增加队列
  61 + logger.warn("[REDIS 消息-推流设备状态变化]: {}", new String(message.getBody()));
  62 + //
60 63 PushStreamStatusChangeFromRedisDto statusChangeFromPushStream = JSON.parseObject(message.getBody(), PushStreamStatusChangeFromRedisDto.class);
61 64 if (statusChangeFromPushStream == null) {
62 65 logger.warn("[REDIS 消息]推流设备状态变化消息解析失败");
63 66 return;
64 67 }
  68 + // 取消定时任务
  69 + dynamicTask.stop(VideoManagerConstants.VM_MSG_GET_ALL_ONLINE_REQUESTED);
65 70 if (statusChangeFromPushStream.isSetAllOffline()) {
66 71 // 所有设备离线
67 72 streamPushService.allStreamOffline();
... ...