This commit is contained in:
@@ -13,7 +13,7 @@ import java.util.function.Consumer;
|
|||||||
import java.util.logging.*;
|
import java.util.logging.*;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import org.redkale.convert.json.*;
|
import org.redkale.convert.json.*;
|
||||||
import org.redkale.net.sncp.Sncp;
|
import org.redkale.net.sncp.*;
|
||||||
import org.redkale.service.*;
|
import org.redkale.service.*;
|
||||||
import org.redkale.util.*;
|
import org.redkale.util.*;
|
||||||
|
|
||||||
@@ -155,22 +155,25 @@ public class CacheMemorySource<K extends Serializable, V extends Object> extends
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (remoteSource != null && !Sncp.isRemote(this)) {
|
if (remoteSource != null && !Sncp.isRemote(this)) {
|
||||||
super.runAsync(() -> {
|
SncpClient client = Sncp.getSncpClient((Service) remoteSource);
|
||||||
try {
|
if (client != null && client.getRemoteGroupTransport() != null) {
|
||||||
CompletableFuture<List<CacheEntry<K, Object>>> listFuture = remoteSource.queryListAsync();
|
super.runAsync(() -> {
|
||||||
listFuture.whenComplete((list, exp) -> {
|
try {
|
||||||
if (exp != null) {
|
CompletableFuture<List<CacheEntry<K, Object>>> listFuture = remoteSource.queryListAsync();
|
||||||
logger.log(Level.FINEST, CacheSource.class.getSimpleName() + "(" + resourceName() + ") queryListAsync error", exp);
|
listFuture.whenComplete((list, exp) -> {
|
||||||
} else {
|
if (exp != null) {
|
||||||
for (CacheEntry<K, Object> entry : list) {
|
logger.log(Level.FINEST, CacheSource.class.getSimpleName() + "(" + resourceName() + ") queryListAsync error", exp);
|
||||||
container.put(entry.key, entry);
|
} else {
|
||||||
|
for (CacheEntry<K, Object> entry : list) {
|
||||||
|
container.put(entry.key, entry);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
} catch (Exception e) {
|
||||||
} catch (Exception e) {
|
logger.log(Level.FINEST, CacheSource.class.getSimpleName() + "(" + resourceName() + ") queryListAsync error, maybe remote node connot connect ", e);
|
||||||
logger.log(Level.FINEST, CacheSource.class.getSimpleName() + "(" + resourceName() + ") queryListAsync error, maybe remote node connot connect ", e);
|
}
|
||||||
}
|
});
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user