设备心跳

This commit is contained in:
shikong 2023-09-13 15:46:53 +08:00
parent ee9b8ce08c
commit 2c973673d0

View File

@ -24,7 +24,7 @@ public class KeepaliveService {
public void keepalive(MockingDevice mockingDevice){
unKeepalive(mockingDevice);
scheduledExecutorService.scheduleWithFixedDelay(()->{
ScheduledFuture<?> scheduledFuture = scheduledExecutorService.scheduleWithFixedDelay(() -> {
KeepaliveNotifyDTO keepaliveNotifyDTO = KeepaliveNotifyDTO.builder()
.deviceId(mockingDevice.getGbDeviceId())
.sn(String.valueOf((int) ((Math.random() * 9 + 1) * 100000)))
@ -40,7 +40,8 @@ public class KeepaliveService {
SipUtil.generateFromTag(),
callIdHeader);
});
},0,30, TimeUnit.SECONDS);
}, 0, 30, TimeUnit.SECONDS);
map.put(mockingDevice.getGbDeviceId(), scheduledFuture);
}
public void unKeepalive(MockingDevice mockingDevice){