优化订阅机制,需要重新订阅时,取消命令发送后再发送订阅命令 #1273

This commit is contained in:
648540858
2024-02-20 11:11:10 +08:00
parent b079039f81
commit a9ab5c28e9
10 changed files with 75 additions and 68 deletions

View File

@@ -153,10 +153,7 @@ public class MobilePositionController {
Device device = storager.queryVideoDevice(deviceId);
device.setSubscribeCycleForMobilePosition(Integer.parseInt(expires));
device.setMobilePositionSubmissionInterval(Integer.parseInt(interval));
deviceService.updateDevice(device);
if (!deviceService.removeMobilePositionSubscribe(device)) {
throw new ControllerException(ErrorCode.ERROR100);
}
deviceService.updateCustomDevice(device);
}
/**

View File

@@ -199,7 +199,7 @@ public class DeviceQuery {
Runnable runnable = dynamicTask.get(key);
if (runnable instanceof ISubscribeTask) {
ISubscribeTask subscribeTask = (ISubscribeTask) runnable;
subscribeTask.stop();
subscribeTask.stop(null);
}
dynamicTask.stop(key);
}