#
Junjie
2025-05-12 0af053b4fe61ff46cebaca25ad4dff77a5c9dd40
src/main/java/com/zy/common/utils/RedisUtil.java
@@ -149,6 +149,17 @@
    public boolean set(String key, Object value) {
        try {
            redisTemplate.opsForValue().set(key, value);
            long start = System.currentTimeMillis();
            while (System.currentTimeMillis() - start < 10000) {//有效期10s
                Object o = redisTemplate.opsForValue().get(key);
                if (o == null) {
                    continue;
                }
                if (o.equals(value)) {
                    break;
                }
            }
            return true;
        } catch (Exception e) {
            e.printStackTrace();