@ -16,7 +16,7 @@ public class VideoManagerConstants {
public static final String CACHEKEY_PREFIX = "VMP_channel_";
public static final String KEEPLIVEKEY_PREFIX = "VMP_keeplive_";
public static final String KEEPLIVEKEY_PREFIX = "VMP_KEEPLIVE_";
public static final String PLAYER_PREFIX = "VMP_player_";
@ -29,5 +29,7 @@ public class SipDeviceRunner implements CommandLineRunner {
public void run(String... args) throws Exception {
// 设置所有设备离线
storager.outlineForAll();
redisCatchStorage.outlineForAll();
}
@ -112,4 +112,9 @@ public interface IRedisCatchStorage {
* @param deviceId 设备ID
*/
void clearCatchByDeviceId(String deviceId);
/**
* 设置所有设备离线
void outlineForAll();
@ -293,4 +293,13 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
@Override
public void outlineForAll() {
List<Object> onlineDevices = redis.scan(String.format("%S*", VideoManagerConstants.KEEPLIVEKEY_PREFIX));
for (int i = 0; i < onlineDevices.size(); i++) {
String key = (String) onlineDevices.get(i);
redis.del(key);