From ecb5b691018c8ff71583833ec9a09d8f2bef81f6 Mon Sep 17 00:00:00 2001
From: 64850858 <648540858@qq.com>
Date: 星期三, 09 六月 2021 09:28:29 +0800
Subject: [PATCH] 增加同步通道超时时间,修复hookIP空字符串时的hookIP的默认值赋值

---
 src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java
index e243d23..776acbf 100644
--- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java
+++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java
@@ -2,6 +2,7 @@
 
 import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
 import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
+import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
 import com.github.pagehelper.PageInfo;
 import io.swagger.annotations.*;
 import org.slf4j.Logger;
@@ -33,6 +34,9 @@
 	
 	@Autowired
 	private IVideoManagerStorager storager;
+
+	@Autowired
+	private IRedisCatchStorage redisCatchStorage;
 	
 	@Autowired
 	private SIPCommander cmder;
@@ -145,7 +149,7 @@
 			msg.setData(String.format("鍚屾閫氶亾澶辫触锛岄敊璇爜锛� %s, %s", response.getStatusCode(), response.getReasonPhrase()));
 			resultHolder.invokeResult(msg);
 		});
-        DeferredResult<ResponseEntity<Device>> result = new DeferredResult<ResponseEntity<Device>>(2*1000L);
+        DeferredResult<ResponseEntity<Device>> result = new DeferredResult<ResponseEntity<Device>>(15*1000L);
 		result.onTimeout(()->{
 			logger.warn(String.format("璁惧閫氶亾淇℃伅鍚屾瓒呮椂"));
 			// 閲婃斁rtpserver
@@ -177,8 +181,10 @@
 		if (offLineDetector.isOnline(deviceId)) {
 			return new ResponseEntity<String>("涓嶅厑璁稿垹闄ゅ湪绾胯澶囷紒", HttpStatus.NOT_ACCEPTABLE);
 		}
+		// 娓呴櫎redis璁板綍
 		boolean isSuccess = storager.delete(deviceId);
 		if (isSuccess) {
+			redisCatchStorage.clearCatchByDeviceId(deviceId);
 			JSONObject json = new JSONObject();
 			json.put("deviceId", deviceId);
 			return new ResponseEntity<>(json.toString(),HttpStatus.OK);

--
Gitblit v1.8.0