From 7e129b703408f5d2f1409f8c5a3af9c4cb3d86f6 Mon Sep 17 00:00:00 2001 From: Junjie <fallin.jie@qq.com> Date: 星期五, 09 五月 2025 09:08:56 +0800 Subject: [PATCH] #充电换层优化 --- zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/RedisUtil.java | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/RedisUtil.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/RedisUtil.java index 411f110..83c158d 100644 --- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/RedisUtil.java +++ b/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(); -- Gitblit v1.9.1