From 2a7432920694e46e62a2b263156aeff43fec374d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Sat, 19 Aug 2023 22:54:42 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E6=95=B4=E7=90=86=20=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/redis/utils/QueueUtils.java | 22 +++++++++---------- .../queue/BoundedQueueController.java | 1 - 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/ruoyi-common/ruoyi-common-redis/src/main/java/org/dromara/common/redis/utils/QueueUtils.java b/ruoyi-common/ruoyi-common-redis/src/main/java/org/dromara/common/redis/utils/QueueUtils.java index f0fcb951..67ce5525 100644 --- a/ruoyi-common/ruoyi-common-redis/src/main/java/org/dromara/common/redis/utils/QueueUtils.java +++ b/ruoyi-common/ruoyi-common-redis/src/main/java/org/dromara/common/redis/utils/QueueUtils.java @@ -131,17 +131,6 @@ public class QueueUtils { return priorityBlockingQueue.offer(data); } - /** - * 尝试设置 有界队列 容量 用于限制数量 - * - * @param queueName 队列名 - * @param capacity 容量 - */ - public static boolean trySetBoundedQueueCapacity(String queueName, int capacity) { - RBoundedBlockingQueue boundedBlockingQueue = CLIENT.getBoundedBlockingQueue(queueName); - return boundedBlockingQueue.trySetCapacity(capacity); - } - /** * 优先队列获取一个队列数据 没有数据返回 null(不支持延迟队列) * @@ -168,6 +157,17 @@ public class QueueUtils { return queue.delete(); } + /** + * 尝试设置 有界队列 容量 用于限制数量 + * + * @param queueName 队列名 + * @param capacity 容量 + */ + public static boolean trySetBoundedQueueCapacity(String queueName, int capacity) { + RBoundedBlockingQueue boundedBlockingQueue = CLIENT.getBoundedBlockingQueue(queueName); + return boundedBlockingQueue.trySetCapacity(capacity); + } + /** * 尝试设置 有界队列 容量 用于限制数量 * diff --git a/ruoyi-modules/ruoyi-demo/src/main/java/org/dromara/demo/controller/queue/BoundedQueueController.java b/ruoyi-modules/ruoyi-demo/src/main/java/org/dromara/demo/controller/queue/BoundedQueueController.java index f2fae0bf..30ec27f7 100644 --- a/ruoyi-modules/ruoyi-demo/src/main/java/org/dromara/demo/controller/queue/BoundedQueueController.java +++ b/ruoyi-modules/ruoyi-demo/src/main/java/org/dromara/demo/controller/queue/BoundedQueueController.java @@ -21,7 +21,6 @@ import org.springframework.web.bind.annotation.RestController; * @author Lion Li * @version 3.6.0 */ -@SaIgnore @Slf4j @RequiredArgsConstructor @RestController