Merge branch 'dev-V0.5.0-gaoyoulong' into dev-V0.5.0
* dev-V0.5.0-gaoyoulong: feat: 虚拟设备 - VirtualManager 定时任务开启;VirtualDeviceController 修改虚拟设备优化V0.5.x
commit
b412eec2a8
|
@ -82,6 +82,9 @@ public class VirtualDeviceController {
|
|||
VirtualDevice oldData = checkOwner(virtualDevice.getId());
|
||||
ReflectUtil.copyNoNulls(virtualDevice, oldData,
|
||||
"name", "productKey", "type", "trigger", "triggerExpression");
|
||||
if (VirtualDevice.STATE_RUNNING.equals(virtualDevice.getState())) {
|
||||
virtualManager.remove(oldData);
|
||||
}
|
||||
virtualDevice.setState(VirtualDevice.STATE_STOPPED);
|
||||
virtualDeviceData.save(virtualDevice);
|
||||
}
|
||||
|
|
|
@ -59,8 +59,8 @@ public class VirtualManager {
|
|||
private MqProducer<ThingModelMessage> producer;
|
||||
|
||||
public VirtualManager(){
|
||||
// ScheduledExecutorService executorService = Executors.newScheduledThreadPool(1);
|
||||
// executorService.schedule(this::init, 8, TimeUnit.SECONDS);
|
||||
ScheduledExecutorService executorService = Executors.newScheduledThreadPool(1);
|
||||
executorService.schedule(this::init, 8, TimeUnit.SECONDS);
|
||||
}
|
||||
|
||||
public void init() {
|
||||
|
|
Loading…
Reference in New Issue