Commit fd0ff18a71c2ba714fca7a0ca4ec8cec9048a5a3
Committed by
GitHub
Merge pull request #1055 from lunasaw/dev-wvp-0905
fix VideoManagerConstants.SIP_SUBSCRIBE_PREFIX key set
Showing
1 changed file
with
6 additions
and
6 deletions
src/main/java/com/genersoft/iot/vmp/gb28181/bean/SubscribeHolder.java
| ... | ... | @@ -2,12 +2,9 @@ package com.genersoft.iot.vmp.gb28181.bean; |
| 2 | 2 | |
| 3 | 3 | import com.genersoft.iot.vmp.common.VideoManagerConstants; |
| 4 | 4 | import com.genersoft.iot.vmp.conf.DynamicTask; |
| 5 | +import com.genersoft.iot.vmp.conf.UserSetting; | |
| 5 | 6 | import com.genersoft.iot.vmp.gb28181.task.ISubscribeTask; |
| 6 | 7 | import com.genersoft.iot.vmp.gb28181.task.impl.MobilePositionSubscribeHandlerTask; |
| 7 | -import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; | |
| 8 | -import com.genersoft.iot.vmp.service.IPlatformService; | |
| 9 | -import com.genersoft.iot.vmp.storager.IRedisCatchStorage; | |
| 10 | -import com.genersoft.iot.vmp.storager.IVideoManagerStorage; | |
| 11 | 8 | import org.springframework.beans.factory.annotation.Autowired; |
| 12 | 9 | import org.springframework.stereotype.Component; |
| 13 | 10 | |
| ... | ... | @@ -24,6 +21,9 @@ public class SubscribeHolder { |
| 24 | 21 | @Autowired |
| 25 | 22 | private DynamicTask dynamicTask; |
| 26 | 23 | |
| 24 | + @Autowired | |
| 25 | + private UserSetting userSetting; | |
| 26 | + | |
| 27 | 27 | private final String taskOverduePrefix = "subscribe_overdue_"; |
| 28 | 28 | |
| 29 | 29 | private static ConcurrentHashMap<String, SubscribeInfo> catalogMap = new ConcurrentHashMap<>(); |
| ... | ... | @@ -58,7 +58,7 @@ public class SubscribeHolder { |
| 58 | 58 | |
| 59 | 59 | public void putMobilePositionSubscribe(String platformId, SubscribeInfo subscribeInfo) { |
| 60 | 60 | mobilePositionMap.put(platformId, subscribeInfo); |
| 61 | - String key = VideoManagerConstants.SIP_SUBSCRIBE_PREFIX + "MobilePosition_" + platformId; | |
| 61 | + String key = VideoManagerConstants.SIP_SUBSCRIBE_PREFIX + userSetting.getServerId() + "MobilePosition_" + platformId; | |
| 62 | 62 | // 添加任务处理GPS定时推送 |
| 63 | 63 | dynamicTask.startCron(key, new MobilePositionSubscribeHandlerTask(platformId), |
| 64 | 64 | subscribeInfo.getGpsInterval() * 1000); |
| ... | ... | @@ -76,7 +76,7 @@ public class SubscribeHolder { |
| 76 | 76 | |
| 77 | 77 | public void removeMobilePositionSubscribe(String platformId) { |
| 78 | 78 | mobilePositionMap.remove(platformId); |
| 79 | - String key = VideoManagerConstants.SIP_SUBSCRIBE_PREFIX + "MobilePosition_" + platformId; | |
| 79 | + String key = VideoManagerConstants.SIP_SUBSCRIBE_PREFIX + userSetting.getServerId() + "MobilePosition_" + platformId; | |
| 80 | 80 | // 结束任务处理GPS定时推送 |
| 81 | 81 | dynamicTask.stop(key); |
| 82 | 82 | String taskOverdueKey = taskOverduePrefix + "MobilePosition_" + platformId; | ... | ... |