Skip to content

Commit dfad818

Browse files
committed
fix: minor fix in push manager on concurrent subscribes and unsubscribes
1 parent 771ac0d commit dfad818

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

server/src/main/java/com/orientechnologies/orient/server/OPushEventType.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.orientechnologies.orient.server;
22

33
import com.orientechnologies.orient.client.remote.message.OBinaryPushRequest;
4-
import java.util.HashSet;
4+
import java.util.Collections;
55
import java.util.Iterator;
66
import java.util.Set;
77
import java.util.concurrent.ConcurrentHashMap;
@@ -26,7 +26,7 @@ public synchronized OBinaryPushRequest<?> getRequest(String database) {
2626
public synchronized void subscribe(String database, OPushInfo protocol) {
2727
Set<OPushInfo> pushSockets = listeners.get(database);
2828
if (pushSockets == null) {
29-
pushSockets = new HashSet<>();
29+
pushSockets = Collections.newSetFromMap(new ConcurrentHashMap<>());
3030
listeners.put(database, pushSockets);
3131
}
3232
pushSockets.add(protocol);

0 commit comments

Comments
 (0)