Junjie
2024-10-16 a9b98ef2b0af7a4a830a2a4d3320d42e2779b152
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/RedisUtil.java
@@ -121,6 +121,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();