修复通知时间会卡主的问题

修复重复获取路由器状态问题
This commit is contained in:
2021-12-18 17:23:12 +08:00
parent 7b1050b4e3
commit e2432b5942
3 changed files with 19 additions and 12 deletions

View File

@@ -23,19 +23,21 @@ public class ApplicationInit implements ApplicationRunner {
if (time.equals(oldTime)) {
return;
}
oldTime=time;
oldTime = time;
for (Class<?> model : Model.classList) {
try {
Model useModel= (Model) model.getDeclaredConstructor().newInstance();
useModel.onTime(time);
} catch (Exception e) {
e.printStackTrace();
}
new Thread(() -> {
try {
Model useModel = (Model) model.getDeclaredConstructor().newInstance();
useModel.onTime(time);
} catch (Exception e) {
e.printStackTrace();
}
}).start();
}
}catch (Exception e){
} catch (Exception e) {
e.printStackTrace();
}
}
},0, 1000);
}, 0, 300);
}
}