Skip to content

Commit

Permalink
wait for completion using allOf().joins()
Browse files Browse the repository at this point in the history
  • Loading branch information
C-Otto committed Jun 7, 2024
1 parent 4fdfa4e commit 08d06ac
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,18 @@ public ChannelDetails getDetails(LocalChannel localChannel) {
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(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,17 @@ public NodeDetails getDetails(Pubkey pubkey) {
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(),
Expand Down

0 comments on commit 08d06ac

Please sign in to comment.