Browse Source

截图定时修改

wyyay 10 months ago
parent
commit
41d4dbda78

+ 2 - 0
business-service/src/main/java/com/ozs/service/service/impl/CameraCaptureService.java

@@ -9,6 +9,7 @@ import javax.annotation.Resource;
 import java.io.*;
 import java.net.HttpURLConnection;
 import java.net.URL;
+import java.util.Date;
 
 /**
  * @author wyy
@@ -64,6 +65,7 @@ public class CameraCaptureService {
                 ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(byteArrayOutputStream.toByteArray());
                 log.info("getCapture======" + fileName);
                 minioUtils.minIoClientUpload(byteArrayInputStream, fileName);
+                System.out.println("fileName"+fileName+"图片结束截图时间"+new Date());
             }
         } catch (Exception e) {
             //先关闭外层的缓冲流,再关闭内层的流,但是在关闭外层流的同时,

+ 3 - 2
hazard-admin/src/main/java/com/ozs/web/controller/shotschedule/TaskService.java

@@ -37,8 +37,8 @@ import java.util.stream.Collectors;
 @Slf4j
 @Service
 public class TaskService {
-    private  static ExecutorService executorService = Executors.newFixedThreadPool(5);
-    private  static ExecutorService alarmExecutorService = Executors.newFixedThreadPool(5);
+    private  static ExecutorService executorService = Executors.newFixedThreadPool(50);
+    private  static ExecutorService alarmExecutorService = Executors.newFixedThreadPool(10);
     @Resource
     BaseCameraManagementService baseCameraManagementService;
     @Resource
@@ -70,6 +70,7 @@ public class TaskService {
                             public void run() {
                                 log.info("调用图片生成服务开始");
                                 try {
+                                    System.out.println("fileName"+fileName+"正常图片开始截图时间"+new Date());
                                     cameraCaptureService.getCapture(url, fileName);
                                 } catch (IOException e) {
                                     e.printStackTrace();