|
|
@@ -4,7 +4,6 @@ import com.genersoft.iot.vmp.common.VideoManagerConstants;
|
|
|
import com.genersoft.iot.vmp.conf.DynamicTask;
|
|
|
import com.genersoft.iot.vmp.conf.UserSetting;
|
|
|
import com.genersoft.iot.vmp.gb28181.task.ISubscribeTask;
|
|
|
-import com.genersoft.iot.vmp.gb28181.task.impl.MobilePositionSubscribeHandlerTask;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
@@ -58,12 +57,19 @@ public class SubscribeHolder {
|
|
|
dynamicTask.stop(taskOverdueKey);
|
|
|
}
|
|
|
|
|
|
- public void putMobilePositionSubscribe(String platformId, SubscribeInfo subscribeInfo) {
|
|
|
+ public void putMobilePositionSubscribe(String platformId, SubscribeInfo subscribeInfo, Runnable gpsTask) {
|
|
|
mobilePositionMap.put(platformId, subscribeInfo);
|
|
|
String key = VideoManagerConstants.SIP_SUBSCRIBE_PREFIX + userSetting.getServerId() + "MobilePosition_" + platformId;
|
|
|
// 添加任务处理GPS定时推送
|
|
|
- dynamicTask.startCron(key, new MobilePositionSubscribeHandlerTask(platformId),
|
|
|
- subscribeInfo.getGpsInterval() * 1000);
|
|
|
+
|
|
|
+ int cycleForCatalog;
|
|
|
+ if (subscribeInfo.getGpsInterval() <= 0) {
|
|
|
+ cycleForCatalog = 5;
|
|
|
+ }else {
|
|
|
+ cycleForCatalog = subscribeInfo.getGpsInterval();
|
|
|
+ }
|
|
|
+ dynamicTask.startCron(key, gpsTask,
|
|
|
+ cycleForCatalog * 1000);
|
|
|
String taskOverdueKey = taskOverduePrefix + "MobilePosition_" + platformId;
|
|
|
if (subscribeInfo.getExpires() > 0) {
|
|
|
// 添加任务处理订阅过期
|