设备心跳
This commit is contained in:
parent
ee9b8ce08c
commit
2c973673d0
@ -24,7 +24,7 @@ public class KeepaliveService {
|
|||||||
|
|
||||||
public void keepalive(MockingDevice mockingDevice){
|
public void keepalive(MockingDevice mockingDevice){
|
||||||
unKeepalive(mockingDevice);
|
unKeepalive(mockingDevice);
|
||||||
scheduledExecutorService.scheduleWithFixedDelay(()->{
|
ScheduledFuture<?> scheduledFuture = scheduledExecutorService.scheduleWithFixedDelay(() -> {
|
||||||
KeepaliveNotifyDTO keepaliveNotifyDTO = KeepaliveNotifyDTO.builder()
|
KeepaliveNotifyDTO keepaliveNotifyDTO = KeepaliveNotifyDTO.builder()
|
||||||
.deviceId(mockingDevice.getGbDeviceId())
|
.deviceId(mockingDevice.getGbDeviceId())
|
||||||
.sn(String.valueOf((int) ((Math.random() * 9 + 1) * 100000)))
|
.sn(String.valueOf((int) ((Math.random() * 9 + 1) * 100000)))
|
||||||
@ -41,6 +41,7 @@ public class KeepaliveService {
|
|||||||
callIdHeader);
|
callIdHeader);
|
||||||
});
|
});
|
||||||
}, 0, 30, TimeUnit.SECONDS);
|
}, 0, 30, TimeUnit.SECONDS);
|
||||||
|
map.put(mockingDevice.getGbDeviceId(), scheduledFuture);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void unKeepalive(MockingDevice mockingDevice){
|
public void unKeepalive(MockingDevice mockingDevice){
|
||||||
|
Loading…
Reference in New Issue
Block a user