|
|
@@ -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));
|
|
|
}
|
|
|
|
|
|
/**
|