优化启动后从redis查询推流设备状态
parent
bf3e181bdb
commit
af27ae0dfc
|
@ -82,7 +82,6 @@ public class HookSubscribe {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addSubscribe(Hook hook, HookSubscribe.Event event) {
|
public void addSubscribe(Hook hook, HookSubscribe.Event event) {
|
||||||
System.out.println("add==" + hook.toString());
|
|
||||||
if (hook.getExpireTime() == null) {
|
if (hook.getExpireTime() == null) {
|
||||||
hook.setExpireTime(System.currentTimeMillis() + subscribeExpire);
|
hook.setExpireTime(System.currentTimeMillis() + subscribeExpire);
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,7 +100,14 @@ public class RedisPushStreamStatusMsgListener implements MessageListener, Applic
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run(ApplicationArguments args) throws Exception {
|
public void run(ApplicationArguments args) throws Exception {
|
||||||
if (!userSetting.isUsePushingAsStatus()) {
|
if (userSetting.isUsePushingAsStatus()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 查询是否存在推流设备,没有则不发送
|
||||||
|
List<String> allAppAndStream = streamPushService.getAllAppAndStream();
|
||||||
|
if (allAppAndStream == null || allAppAndStream.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
// 启动时设置所有推流通道离线,发起查询请求
|
// 启动时设置所有推流通道离线,发起查询请求
|
||||||
redisCatchStorage.sendStreamPushRequestedMsgForStatus();
|
redisCatchStorage.sendStreamPushRequestedMsgForStatus();
|
||||||
dynamicTask.startDelay(VideoManagerConstants.VM_MSG_GET_ALL_ONLINE_REQUESTED, () -> {
|
dynamicTask.startDelay(VideoManagerConstants.VM_MSG_GET_ALL_ONLINE_REQUESTED, () -> {
|
||||||
|
@ -109,6 +116,5 @@ public class RedisPushStreamStatusMsgListener implements MessageListener, Applic
|
||||||
streamPushService.allOffline();
|
streamPushService.allOffline();
|
||||||
}, 5000);
|
}, 5000);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue