Browse Source

更改超時時間

gaoyu 3 years ago
parent
commit
1a483e5f40

+ 8 - 5
src/main/java/com/persagy/service/impl/AlarmHandleServiceImpl.java

@@ -16,9 +16,6 @@ import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.stream.Collectors;
 
-import com.persagy.entity.*;
-import com.persagy.enumeration.YesNoEnum;
-import com.persagy.repository.AlarmLastTimeRepository;
 import org.apache.commons.lang3.StringUtils;
 import org.quartz.JobDataMap;
 import org.springframework.amqp.core.Message;
@@ -42,6 +39,12 @@ import com.persagy.cache.AlarmLastTimeCache;
 import com.persagy.cache.AlarmRedisCache;
 import com.persagy.cache.CreatedAlarmIdsCache;
 import com.persagy.client.GroupNettyClient;
+import com.persagy.entity.AlarmConditionState;
+import com.persagy.entity.AlarmDefine;
+import com.persagy.entity.AlarmRecord;
+import com.persagy.entity.Condition;
+import com.persagy.entity.ExpireAlarmMessage;
+import com.persagy.entity.ZktAlarmRecordDO;
 import com.persagy.entity.v2.AlarmCondition;
 import com.persagy.entity.v2.DmpMessage;
 import com.persagy.entity.v2.ItemCodeCondition;
@@ -380,7 +383,7 @@ public class AlarmHandleServiceImpl implements AlarmHandleService {
 			log.debug("报警恢复持续时间大于设定时间:[{}]>[{}]", alarmSuspendLastTime, uphold);
 			ZktAlarmRecordDO alarmRecordDO = getZktAlarmRecordDOWhenAlarmSuspend(defineId, dataTime, paramMap);
 			String alarmId = alarmRecordDO.getAlarmId();
-			alarmRedisCache.lock(alarmId, alarmId, 1000);
+			alarmRedisCache.lock(alarmId, alarmId, 10);
 			// 发送报警恢复消息
 			sendAlarmRecoverMessage(defineId, alarmSuspendStartTime, paramMap, alarmId);
 			// 取消过期任务
@@ -700,7 +703,7 @@ public class AlarmHandleServiceImpl implements AlarmHandleService {
 		dmpMessage.setProjectId(projectId);
 		dmpMessage.setGroupCode(groupCode);
 		dmpMessage.setExts(message);
-		alarmRedisCache.lock(alarmId, alarmId, 1000);
+		alarmRedisCache.lock(alarmId, alarmId, 10);
 		rabbitTemplate.convertAndSend(RabbitConfig.exchangeAlarm, RabbitConfig.alarmMsgRoutingKey,
 				JSON.toJSONString(dmpMessage));
 	}