临时提交

pull/1642/head
648540858 2024-06-25 17:46:33 +08:00
parent 7255e5a887
commit 81049b5a9e
2 changed files with 6 additions and 9 deletions

View File

@ -231,7 +231,7 @@ public class StreamPushServiceImpl implements IStreamPushService {
@Override @Override
public boolean stop(String app, String stream) { public boolean stop(String app, String stream) {
logger.info("[推流] 停止流: {}/{}", app, stream); logger.info("[推流] 停止流: {}/{}", app, stream);
StreamPush streamPushItem = streamPushMapper.selectOne(app, stream); StreamPush streamPushItem = streamPushMapper.selectOne(app, stream);
if (streamPushItem != null) { if (streamPushItem != null) {
gbStreamService.sendCatalogMsg(streamPushItem, CatalogEvent.DEL); gbStreamService.sendCatalogMsg(streamPushItem, CatalogEvent.DEL);

View File

@ -3,9 +3,8 @@ package com.genersoft.iot.vmp.service.redisMsg;
import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.genersoft.iot.vmp.service.IStreamPushService; import com.genersoft.iot.vmp.service.IStreamPushService;
import lombok.extern.slf4j.Slf4j;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.redis.connection.Message; import org.springframework.data.redis.connection.Message;
@ -17,14 +16,13 @@ import java.util.concurrent.ConcurrentLinkedQueue;
/** /**
* redis * redis
* PUBLISH VM_MSG_STREAM_PUSH_CLOSE "{'app': 'live', 'stream': 'stream'}"
* @author lin * @author lin
*/ */
@Slf4j
@Component @Component
public class RedisCloseStreamMsgListener implements MessageListener { public class RedisCloseStreamMsgListener implements MessageListener {
private final static Logger logger = LoggerFactory.getLogger(RedisCloseStreamMsgListener.class);
@Autowired @Autowired
private IStreamPushService pushService; private IStreamPushService pushService;
@ -47,10 +45,9 @@ public class RedisCloseStreamMsgListener implements MessageListener {
String app = jsonObject.getString("app"); String app = jsonObject.getString("app");
String stream = jsonObject.getString("stream"); String stream = jsonObject.getString("stream");
pushService.stop(app, stream); pushService.stop(app, stream);
}catch (Exception e) { }catch (Exception e) {
logger.warn("[REDIS的关闭推流通知] 发现未处理的异常, \r\n{}", JSON.toJSONString(message)); log.warn("[REDIS的关闭推流通知] 发现未处理的异常, \r\n{}", JSON.toJSONString(message));
logger.error("[REDIS的关闭推流通知] 异常内容: ", e); log.error("[REDIS的关闭推流通知] 异常内容: ", e);
} }
} }
}); });