zyx 1 rok temu
rodzic
commit
706c054ae5

+ 3 - 2
src/main/java/com/sxtvs/open/api/review/service/impl/SSEService.java

@@ -12,13 +12,14 @@ import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Optional;
+import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ThreadPoolExecutor;
 
 @Service
 public class SSEService {
 
-    private Map<Long, SseEmitter>  sseMap = new HashMap<>();
-    private Map<Long, SseEmitter>  sseDataMap = new HashMap<>();
+    private Map<Long, SseEmitter>  sseMap = new ConcurrentHashMap<>();
+    private Map<Long, SseEmitter>  sseDataMap = new ConcurrentHashMap<>();
 
     public void monitor(String token, SseEmitter sseEmitter) {