This commit is contained in:
@@ -41,11 +41,13 @@ public class WebSocketNodeService extends WebSocketNode implements Service {
|
|||||||
if (localSncpAddress == null || !localSncpAddress.equals(targetAddress)) return remoteWebSocketAddresses(targetAddress, groupid);
|
if (localSncpAddress == null || !localSncpAddress.equals(targetAddress)) return remoteWebSocketAddresses(targetAddress, groupid);
|
||||||
if (this.localEngine == null) return CompletableFuture.completedFuture(new ArrayList<>());
|
if (this.localEngine == null) return CompletableFuture.completedFuture(new ArrayList<>());
|
||||||
|
|
||||||
ExecutorService executor = ForkJoinPool.commonPool();
|
ExecutorService executor = null;
|
||||||
Thread thread = Thread.currentThread();
|
Thread thread = Thread.currentThread();
|
||||||
if (thread instanceof WorkThread) {
|
if (thread instanceof WorkThread) {
|
||||||
executor = ((WorkThread) thread).getExecutor();
|
executor = ((WorkThread) thread).getExecutor();
|
||||||
}
|
}
|
||||||
|
if (executor == null) executor = ForkJoinPool.commonPool();
|
||||||
|
|
||||||
return CompletableFuture.supplyAsync(() -> {
|
return CompletableFuture.supplyAsync(() -> {
|
||||||
final List<String> rs = new ArrayList<>();
|
final List<String> rs = new ArrayList<>();
|
||||||
this.localEngine.getLocalWebSockets(groupid).forEach(x -> rs.add(x.getRemoteAddr()));
|
this.localEngine.getLocalWebSockets(groupid).forEach(x -> rs.add(x.getRemoteAddr()));
|
||||||
|
|||||||
Reference in New Issue
Block a user