From 741c9bcc56f1480300c946d835c540ad5a41b446 Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Fri, 12 Dec 2025 17:17:57 +0800
Subject: [PATCH] feat(wangge): 调整网格交易参数配置

---
 src/main/java/com/xcong/excoin/utils/RedisUtils.java |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/xcong/excoin/utils/RedisUtils.java b/src/main/java/com/xcong/excoin/utils/RedisUtils.java
index 936fab4..6110ef3 100644
--- a/src/main/java/com/xcong/excoin/utils/RedisUtils.java
+++ b/src/main/java/com/xcong/excoin/utils/RedisUtils.java
@@ -90,6 +90,35 @@
     public Object get(String key) {
         return key == null ? null : redisTemplate.opsForValue().get(key);
     }
+    public Object getWithDelay(String key) {
+        // 在读取前添加短暂延迟
+        try {
+            Thread.sleep(50); // 等待50ms让Redis同步完成
+        } catch (InterruptedException e) {
+            Thread.currentThread().interrupt();
+        }
+        return key == null ? null : redisTemplate.opsForValue().get(key);
+    }
+
+
+    /**
+     * 普通缓存获取
+     * @param key 键
+     * @return 值
+     */
+    public String getStringWithDelay(String key) {
+        // 在读取前添加短暂延迟
+        try {
+            Thread.sleep(50); // 等待50ms让Redis同步完成
+        } catch (InterruptedException e) {
+            Thread.currentThread().interrupt();
+        }
+        Object obj = key == null ? null : redisTemplate.opsForValue().get(key);
+        if(obj!=null){
+            return obj.toString();
+        }
+        return null;
+    }
 
 
     /**

--
Gitblit v1.9.1