修正了如果设备不存在以及不在线的时候没有 释放请求的问题
parent
7fc38ad9b3
commit
8db82c8e69
|
@ -95,12 +95,22 @@ public class DownloadController {
|
||||||
Device device = storager.queryVideoDevice(deviceId);
|
Device device = storager.queryVideoDevice(deviceId);
|
||||||
if (device == null) {
|
if (device == null) {
|
||||||
result.setResult(new ResponseEntity<>(HttpStatus.BAD_REQUEST));
|
result.setResult(new ResponseEntity<>(HttpStatus.BAD_REQUEST));
|
||||||
|
RequestMessage msg = new RequestMessage();
|
||||||
|
msg.setId(uuid);
|
||||||
|
msg.setKey(key);
|
||||||
|
msg.setData("设备不存在");
|
||||||
|
resultHolder.invokeAllResult(msg);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
//判断设备是否在线,不在线直接返回
|
//判断设备是否在线,不在线直接返回
|
||||||
if(device.getOnline()==0)
|
if(device.getOnline()==0)
|
||||||
{
|
{
|
||||||
result.setResult(new ResponseEntity<>(HttpStatus.BAD_REQUEST));
|
result.setResult(new ResponseEntity<>(HttpStatus.BAD_REQUEST));
|
||||||
|
RequestMessage msg = new RequestMessage();
|
||||||
|
msg.setId(uuid);
|
||||||
|
msg.setKey(key);
|
||||||
|
msg.setData("设备不在线");
|
||||||
|
resultHolder.invokeAllResult(msg);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
StreamInfo streamInfo = redisCatchStorage.queryPlaybackByDevice(deviceId, channelId);
|
StreamInfo streamInfo = redisCatchStorage.queryPlaybackByDevice(deviceId, channelId);
|
||||||
|
|
|
@ -83,12 +83,22 @@ public class PlaybackController {
|
||||||
Device device = storager.queryVideoDevice(deviceId);
|
Device device = storager.queryVideoDevice(deviceId);
|
||||||
if (device == null) {
|
if (device == null) {
|
||||||
result.setResult(new ResponseEntity<>(HttpStatus.BAD_REQUEST));
|
result.setResult(new ResponseEntity<>(HttpStatus.BAD_REQUEST));
|
||||||
|
RequestMessage msg = new RequestMessage();
|
||||||
|
msg.setId(uuid);
|
||||||
|
msg.setKey(key);
|
||||||
|
msg.setData("设备不存在");
|
||||||
|
resultHolder.invokeAllResult(msg);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
//判断设备是否在线,不在线直接返回
|
//判断设备是否在线,不在线直接返回
|
||||||
if(device.getOnline()==0)
|
if(device.getOnline()==0)
|
||||||
{
|
{
|
||||||
result.setResult(new ResponseEntity<>(HttpStatus.BAD_REQUEST));
|
result.setResult(new ResponseEntity<>(HttpStatus.BAD_REQUEST));
|
||||||
|
RequestMessage msg = new RequestMessage();
|
||||||
|
msg.setId(uuid);
|
||||||
|
msg.setKey(key);
|
||||||
|
msg.setData("设备不在线");
|
||||||
|
resultHolder.invokeAllResult(msg);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
MediaServerItem newMediaServerItem = playService.getNewMediaServerItem(device);
|
MediaServerItem newMediaServerItem = playService.getNewMediaServerItem(device);
|
||||||
|
|
Loading…
Reference in New Issue