|
|
@@ -35,25 +35,25 @@ public class StartListener implements CommandLineRunner {
|
|
|
@Override
|
|
|
public void run(String... args) {
|
|
|
//定时调度,无法使用scheduledExecutorService完成定时调度,scheduledExecutorService默认实现了jdk自动关闭策略,默认会杀死程序,此处手动实现延时调用
|
|
|
- taskExecutor.execute(new Runnable() {
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- try {
|
|
|
- String streamUrl = fireProperties.getStreamUrl();
|
|
|
- if (streamUrl == null) {
|
|
|
- throw new ServiceException("未配置流媒体地址");
|
|
|
- }
|
|
|
- while (true) {
|
|
|
- fireImageService.catchImage();
|
|
|
- Thread.sleep(fireProperties.getWaitTime() * 1000L);
|
|
|
- }
|
|
|
- } catch (ServiceException | IOException | InterruptedException e) {
|
|
|
- //异常回调,防止系统因异常问题被杀死
|
|
|
- log.error("=========调用产生异常:{}============", e.getMessage());
|
|
|
- run();
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
+// taskExecutor.execute(new Runnable() {
|
|
|
+// @Override
|
|
|
+// public void run() {
|
|
|
+// try {
|
|
|
+// String streamUrl = fireProperties.getStreamUrl();
|
|
|
+// if (streamUrl == null) {
|
|
|
+// throw new ServiceException("未配置流媒体地址");
|
|
|
+// }
|
|
|
+// while (true) {
|
|
|
+// fireImageService.catchImage();
|
|
|
+// Thread.sleep(fireProperties.getWaitTime() * 1000L);
|
|
|
+// }
|
|
|
+// } catch (ServiceException | IOException | InterruptedException e) {
|
|
|
+// //异常回调,防止系统因异常问题被杀死
|
|
|
+// log.error("=========调用产生异常:{}============", e.getMessage());
|
|
|
+// run();
|
|
|
+// }
|
|
|
+// }
|
|
|
+// });
|
|
|
}
|
|
|
|
|
|
}
|