浏览代码

style(同步主分支代码): 同步主分支代码

同步主分支代码
zjian 1 月之前
父节点
当前提交
683a0140ad

+ 1 - 4
snowy-plugin/snowy-plugin-coldchain/src/main/java/vip/xiaonuo/coldchain/core/alarm/service/delay/DeviceAlertDelayService.java

@@ -6,7 +6,6 @@ import org.springframework.data.redis.core.StringRedisTemplate;
 import org.springframework.stereotype.Service;
 
 import java.time.Duration;
-import java.util.concurrent.TimeUnit;
 
 /**
  * @author jackzhou 2025 11-03 23:05
@@ -29,9 +28,7 @@ public class DeviceAlertDelayService {
      */
     public void disableDeviceAlert(String deviceCode, long hours) {
         String key = buildDeviceKey(deviceCode);
-        redisTemplate.opsForValue().set(key, String.valueOf(hours), hours, TimeUnit.HOURS);
-        //下面方法会导致 ERR invalid expire time in setex
-//        redisTemplate.opsForValue().set(key, String.valueOf(hours), Duration.ofHours(hours));
+        redisTemplate.opsForValue().set(key, String.valueOf(hours), Duration.ofHours(hours));
     }
 
     /**