Commit 0b1cae75fe601bacc1b610bcd4f0c58a365e06e3
1 parent
74d97734
动态人物管理增加自检机制。防止内存溢出
Showing
5 changed files
with
18 additions
and
8 deletions
src/main/java/com/genersoft/iot/vmp/conf/DynamicTask.java
| @@ -5,6 +5,7 @@ import org.slf4j.Logger; | @@ -5,6 +5,7 @@ import org.slf4j.Logger; | ||
| 5 | import org.slf4j.LoggerFactory; | 5 | import org.slf4j.LoggerFactory; |
| 6 | import org.springframework.beans.factory.annotation.Autowired; | 6 | import org.springframework.beans.factory.annotation.Autowired; |
| 7 | import org.springframework.context.annotation.Bean; | 7 | import org.springframework.context.annotation.Bean; |
| 8 | +import org.springframework.scheduling.annotation.Scheduled; | ||
| 8 | import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; | 9 | import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; |
| 9 | import org.springframework.stereotype.Component; | 10 | import org.springframework.stereotype.Component; |
| 10 | 11 | ||
| @@ -120,4 +121,19 @@ public class DynamicTask { | @@ -120,4 +121,19 @@ public class DynamicTask { | ||
| 120 | public Runnable get(String key) { | 121 | public Runnable get(String key) { |
| 121 | return runnableMap.get(key); | 122 | return runnableMap.get(key); |
| 122 | } | 123 | } |
| 124 | + | ||
| 125 | + /** | ||
| 126 | + * 每五分钟检查失效的任务,并移除 | ||
| 127 | + */ | ||
| 128 | + @Scheduled(cron="0 0/5 * * * ?") | ||
| 129 | + public void execute(){ | ||
| 130 | + if (futureMap.size() > 0) { | ||
| 131 | + for (String key : futureMap.keySet()) { | ||
| 132 | + if (futureMap.get(key).isDone()) { | ||
| 133 | + futureMap.remove(key); | ||
| 134 | + runnableMap.remove(key); | ||
| 135 | + } | ||
| 136 | + } | ||
| 137 | + } | ||
| 138 | + } | ||
| 123 | } | 139 | } |
src/main/java/com/genersoft/iot/vmp/domain/req/PresetQuerySipReq.java renamed to src/main/java/com/genersoft/iot/vmp/gb28181/bean/PresetQuerySipReq.java
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/PresetQueryResponseMessageHandler.java
| 1 | package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.response.cmd; | 1 | package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.response.cmd; |
| 2 | 2 | ||
| 3 | -import com.genersoft.iot.vmp.domain.req.PresetQuerySipReq; | 3 | +import com.genersoft.iot.vmp.gb28181.bean.PresetQuerySipReq; |
| 4 | import com.genersoft.iot.vmp.gb28181.bean.*; | 4 | import com.genersoft.iot.vmp.gb28181.bean.*; |
| 5 | import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; | 5 | import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; |
| 6 | import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; | 6 | import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; |
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/media/MediaController.java
| @@ -36,14 +36,8 @@ public class MediaController { | @@ -36,14 +36,8 @@ public class MediaController { | ||
| 36 | private IRedisCatchStorage redisCatchStorage; | 36 | private IRedisCatchStorage redisCatchStorage; |
| 37 | 37 | ||
| 38 | @Autowired | 38 | @Autowired |
| 39 | - private IStreamPushService streamPushService; | ||
| 40 | - | ||
| 41 | - @Autowired | ||
| 42 | private IMediaService mediaService; | 39 | private IMediaService mediaService; |
| 43 | 40 | ||
| 44 | - @Autowired | ||
| 45 | - private IMediaServerService mediaServerService; | ||
| 46 | - | ||
| 47 | 41 | ||
| 48 | /** | 42 | /** |
| 49 | * 根据应用名和流id获取播放地址 | 43 | * 根据应用名和流id获取播放地址 |
src/main/resources/8042900_www.wvp-pro.cn.jks
0 → 100644
No preview for this file type