From 93acbd775e747c54eaf54e9a70052021a409ae5c Mon Sep 17 00:00:00 2001 From: TanJ Date: Wed, 15 Oct 2025 10:09:45 +0800 Subject: [PATCH] =?UTF-8?q?feta(RDMP-5834)=20=20keys=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E6=8A=9B=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/common/util/RedisUtils.java | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/workflow-engine-server/src/main/java/cn/axzo/workflow/server/common/util/RedisUtils.java b/workflow-engine-server/src/main/java/cn/axzo/workflow/server/common/util/RedisUtils.java index fcb207f7a..852743db0 100644 --- a/workflow-engine-server/src/main/java/cn/axzo/workflow/server/common/util/RedisUtils.java +++ b/workflow-engine-server/src/main/java/cn/axzo/workflow/server/common/util/RedisUtils.java @@ -455,31 +455,39 @@ public class RedisUtils { /** * 获得缓存的基本对象列表 + * 禁止使用,会导致Redis阻塞 * * @param pattern 字符串前缀 * @return 对象列表 */ + @Deprecated public static Collection keys(final String pattern) { - Stream stream = CLIENT.getKeys().getKeysStreamByPattern(pattern); - return stream.collect(Collectors.toList()); +// Stream stream = CLIENT.getKeys().getKeysStreamByPattern(pattern); +// return stream.collect(Collectors.toList()); + throw new UnsupportedOperationException("禁止使用keys命令,请使用scan"); } /** * 删除缓存的基本对象列表 * * @param pattern 字符串前缀 + * 禁止使用,会导致Redis阻塞 */ + @Deprecated public static void deleteKeys(final String pattern) { - CLIENT.getKeys().deleteByPattern(pattern); +// CLIENT.getKeys().deleteByPattern(pattern); + throw new UnsupportedOperationException("禁止使用keys命令,请使用scan"); } /** * 检查redis中是否存在key - * + * 禁止使用,会导致Redis阻塞 * @param key 键 */ + @Deprecated public static Boolean hasKey(String key) { - RKeys rKeys = CLIENT.getKeys(); - return rKeys.countExists(key) > 0; +// RKeys rKeys = CLIENT.getKeys(); +// return rKeys.countExists(key) > 0; + throw new UnsupportedOperationException("禁止使用keys命令,请使用scan"); } }