فهرست منبع

截图代码频次修改

wyyay 7 ماه پیش
والد
کامیت
27eef76b00

+ 4 - 1
hazard-admin/src/main/java/com/ozs/web/controller/shotschedule/CaptureStreamListener.java

@@ -102,13 +102,16 @@ public class CaptureStreamListener implements StreamListener<String, ObjectRecor
         } finally {
             Boolean isAlarm = vo.getIsAlarm();
             if (isAlarm) {
-                vo.setNextExecuteTime(DateTime.now().offset(DateField.SECOND, 30).toString("yyyy-MM-dd HH:mm:ss"));
+                vo.setNextExecuteTime(DateTime.now().offset(DateField.SECOND, 1).toString("yyyy-MM-dd HH:mm:ss"));
             } else {
                 vo.setNextExecuteTime(DateTime.now().offset(DateField.MINUTE, 1).toString("yyyy-MM-dd HH:mm:ss"));
             }
             vo.setStatus("complete");
             redisService.addToHash(isAlarm ? ShotPictureTaskExecutors.CAMERA_ALARM_HASH :
                     ShotPictureTaskExecutors.CAMERA_NORMAL_HASH, vo.getCameraCode(), vo);
+            if(isAlarm){
+                redisService.addToHash(ShotPictureTaskExecutors.CAMERA_ALARM_HASH,vo.getCameraCode(),vo);
+            }
             ShotPictureTaskExecutors.RUNNING_ATOMIC_INT.decrementAndGet();
         }
     }

+ 1 - 1
hazard-admin/src/main/java/com/ozs/web/controller/shotschedule/ShotPictureTaskExecutors.java

@@ -160,7 +160,7 @@ public class ShotPictureTaskExecutors {
     /**
      * 处理预警摄像头截图, 间隔: 5s
      */
-    @Scheduled(fixedDelay = 5 * 1000, initialDelay = 10 * 1000)
+    @Scheduled(fixedDelay = 1 * 1000, initialDelay = 10 * 1000)
     public void batchProcess() {
         if (!isMaster) return;
         // 填充默认路径