Skip to content

Commit

Permalink
Try removing lambda
Browse files Browse the repository at this point in the history
  • Loading branch information
sappenin committed Nov 26, 2024
1 parent 8c4ef32 commit 0a8b0c1
Showing 1 changed file with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,20 @@ public class RippledContainer {
LOGGER.warn("Ledger accept failed", e);
}
};

private void acceptCurrentLedger(RippledContainer rippledContainer) {
try {
AcceptLedgerResult status = rippledContainer.getXrplAdminClient().acceptLedger();
LOGGER.info("Accepted ledger status: {}", status);
} catch (RuntimeException | JsonRpcClientErrorException e) {
LOGGER.warn("Ledger accept failed", e);
}
}

private final GenericContainer<?> rippledContainer;
private final ScheduledExecutorService ledgerAcceptor;
private boolean started;

/**
* No-args constructor.
*/
Expand Down Expand Up @@ -121,7 +131,8 @@ public RippledContainer start(int acceptIntervalMillis) {
ledgerAcceptor.scheduleAtFixedRate(() -> LEDGER_ACCEPTOR.accept(this),
acceptIntervalMillis,
acceptIntervalMillis,
TimeUnit.MILLISECONDS);
TimeUnit.MILLISECONDS
);
waitForLedgerTimeToSync();
return this;
}
Expand Down Expand Up @@ -197,6 +208,6 @@ public HttpUrl getBaseUri() {
*/
public void acceptLedger() {
assertContainerStarted();
LEDGER_ACCEPTOR.accept(this);
this.acceptCurrentLedger(this);
}
}

0 comments on commit 0a8b0c1

Please sign in to comment.