From 6f0dd8dc8939a6dfd85deb0dc8c818dc3bc0cf01 Mon Sep 17 00:00:00 2001
From: 疯狂的牛子Li <freezing_hmj@163.com>
Date: 星期二, 14 一月 2025 13:40:07 +0800
Subject: [PATCH] !636 update 优化 支持通过配置文件关闭工作流 * update 优化 支持通过配置文件关闭工作流

---
 ruoyi-common/ruoyi-common-sse/src/main/java/org/dromara/common/sse/utils/SseMessageUtils.java |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/ruoyi-common/ruoyi-common-sse/src/main/java/org/dromara/common/sse/utils/SseMessageUtils.java b/ruoyi-common/ruoyi-common-sse/src/main/java/org/dromara/common/sse/utils/SseMessageUtils.java
index 45f354c..5861034 100644
--- a/ruoyi-common/ruoyi-common-sse/src/main/java/org/dromara/common/sse/utils/SseMessageUtils.java
+++ b/ruoyi-common/ruoyi-common-sse/src/main/java/org/dromara/common/sse/utils/SseMessageUtils.java
@@ -17,7 +17,13 @@
 public class SseMessageUtils {
 
     private final static Boolean SSE_ENABLE = SpringUtils.getProperty("sse.enabled", Boolean.class, true);
-    private final static SseEmitterManager MANAGER = SpringUtils.getBean(SseEmitterManager.class);
+    private static SseEmitterManager MANAGER;
+
+    static {
+        if (isEnable() && MANAGER == null) {
+            MANAGER = SpringUtils.getBean(SseEmitterManager.class);
+        }
+    }
 
     /**
      * 鍚戞寚瀹氱殑WebSocket浼氳瘽鍙戦�佹秷鎭�

--
Gitblit v1.9.3