wait for completion using allOf().joins()

This commit is contained in:
Carsten Otto
2024-06-07 17:53:47 +02:00
parent 4fdfa4eede
commit 08d06ac0f9
2 changed files with 23 additions and 0 deletions

View File

@@ -66,6 +66,18 @@ public class ChannelDetailsService {
CompletableFuture<ChannelWarnings> channelWarnings = getChannelWarnings(localChannel);
CompletableFuture<Optional<ChannelRating>> rating = getRating(channelId);
try {
CompletableFuture.allOf(
remoteAlias,
balanceInformation,
onChainCosts,
policies,
feeReport,
flowReport,
rebalanceReport,
channelWarnings,
rating
).join();
return new ChannelDetails(
localChannel,
remoteAlias.get(),

View File

@@ -78,6 +78,17 @@ public class NodeDetailsService {
List<ChannelId> forceClosingChannelIds =
getSortedChannelIds(channelService.getForceClosingChannelsWith(pubkey));
try {
CompletableFuture.allOf(
node,
onlineReport,
onChainCosts,
balanceInformation,
feeReport,
flowReport,
rebalanceReport,
nodeWarnings,
rating
).join();
return new NodeDetails(
pubkey,
node.get().alias(),