class PendingFundCleaner {

    @Scheduled(fixedDelay = 300_000 /* 5 minutes */)
    public void cleanupPendingFunds() {
        pendingFundService.findAll()
                          .stream()
                          .filter(fund -> {
                              try {
                                  return hasFailed(fund) || hasAged(fund);
                              } catch (final Exception ex) {
                                  log.error("Unable to fetch status for transaction {} : ", fund.getTransactionHash(), ex.getMessage());
                                  return false;
                              }
                          })
                          .forEach(pendingFundService::removePendingFund);
    }

    public  PendingFundCleaner(final PendingFundService pendingFundService,
                              final AzraelClient azraelClient);

}