修复离线失败 #1944
This commit is contained in:
@@ -50,14 +50,6 @@ public class SipSubscribe {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateTimeout(String callId) {
|
|
||||||
SipEvent sipEvent = subscribes.get(callId);
|
|
||||||
if (sipEvent != null) {
|
|
||||||
delayQueue.remove(sipEvent);
|
|
||||||
delayQueue.offer(sipEvent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public interface Event { void response(EventResult eventResult);
|
public interface Event { void response(EventResult eventResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -94,7 +94,10 @@ public class DeviceStatusTaskRunner {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
log.debug("[更新状态任务时间] 编号: {}", key);
|
log.debug("[更新状态任务时间] 编号: {}", key);
|
||||||
|
// 如果值更改时间,如果队列中有多个元素时 超时无法出发。目前采用移除再加入的方法
|
||||||
|
delayQueue.remove(task);
|
||||||
task.setDelayTime(expirationTime);
|
task.setDelayTime(expirationTime);
|
||||||
|
delayQueue.offer(task);
|
||||||
String redisKey = String.format("%s_%s_%s", prefix, userSetting.getServerId(), task.getDeviceId());
|
String redisKey = String.format("%s_%s_%s", prefix, userSetting.getServerId(), task.getDeviceId());
|
||||||
Duration duration = Duration.ofSeconds((expirationTime - System.currentTimeMillis())/1000);
|
Duration duration = Duration.ofSeconds((expirationTime - System.currentTimeMillis())/1000);
|
||||||
redisTemplate.expire(redisKey, duration);
|
redisTemplate.expire(redisKey, duration);
|
||||||
|
|||||||
@@ -94,7 +94,9 @@ public class SubscribeTaskRunner{
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
log.info("[更新订阅任务时间] {}, 编号: {}", task.getName(), key);
|
log.info("[更新订阅任务时间] {}, 编号: {}", task.getName(), key);
|
||||||
|
delayQueue.remove(task);
|
||||||
task.setDelayTime(expirationTime);
|
task.setDelayTime(expirationTime);
|
||||||
|
delayQueue.offer(task);
|
||||||
String redisKey = String.format("%s_%s_%s", prefix, userSetting.getServerId(), task.getKey());
|
String redisKey = String.format("%s_%s_%s", prefix, userSetting.getServerId(), task.getKey());
|
||||||
Duration duration = Duration.ofSeconds((expirationTime - System.currentTimeMillis())/1000);
|
Duration duration = Duration.ofSeconds((expirationTime - System.currentTimeMillis())/1000);
|
||||||
redisTemplate.expire(redisKey, duration);
|
redisTemplate.expire(redisKey, duration);
|
||||||
|
|||||||
@@ -108,19 +108,6 @@ public class PlatformStatusTaskRunner {
|
|||||||
return task.getSipTransactionInfo();
|
return task.getSipTransactionInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean updateRegisterDelay(String platformServerId, long expirationTime) {
|
|
||||||
PlatformRegisterTask task = registerSubscribes.get(platformServerId);
|
|
||||||
if (task == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
log.info("[更新平台注册任务时间] 平台上级编号: {}", platformServerId);
|
|
||||||
task.setDelayTime(expirationTime);
|
|
||||||
String redisKey = String.format("%s_%s_%s", prefix, userSetting.getServerId(), platformServerId);
|
|
||||||
Duration duration = Duration.ofSeconds((expirationTime - System.currentTimeMillis())/1000);
|
|
||||||
redisTemplate.expire(redisKey, duration);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean containsRegister(String platformServerId) {
|
public boolean containsRegister(String platformServerId) {
|
||||||
return registerSubscribes.containsKey(platformServerId);
|
return registerSubscribes.containsKey(platformServerId);
|
||||||
}
|
}
|
||||||
@@ -152,16 +139,6 @@ public class PlatformStatusTaskRunner {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean updateKeepAliveDelay(String platformServerId, long expirationTime) {
|
|
||||||
PlatformKeepaliveTask task = keepaliveSubscribes.get(platformServerId);
|
|
||||||
if (task == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
log.info("[更新平台心跳任务时间] 平台上级编号: {}", platformServerId);
|
|
||||||
task.setDelayTime(expirationTime);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean containsKeepAlive(String platformServerId) {
|
public boolean containsKeepAlive(String platformServerId) {
|
||||||
return keepaliveSubscribes.containsKey(platformServerId);
|
return keepaliveSubscribes.containsKey(platformServerId);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user