Browse Source

截图定时优化

wyyay 7 tháng trước cách đây
mục cha
commit
1397b46da9

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

@@ -136,6 +136,10 @@ public class ShotPictureTaskExecutors {
                     }
                     // 排除缓存中未删除, 但是系统中删除的情况
                     for (Object hashAlarmKey : hashAlarmKeys) {
+                        //如果报警信息数据库不存在但报警缓存中存在, 则进行删除
+                        if(!lockedMsgAlarmCameraCodes.contains(hashAlarmKey)){
+                            redisService.redisTemplate.opsForHash().delete(CAMERA_ALARM_HASH, hashAlarmKey);
+                        }
                         // 如果在数据库中都不存在, 则进行删除删除
                         if (!hashAlarmKeys.contains(hashAlarmKey) && !hashNormalKeys.contains(hashAlarmKey)) {
                             redisService.redisTemplate.opsForHash().delete(CAMERA_ALARM_HASH, hashAlarmKey);