class RpkiObjectCleanupService {

    public long cleanupRpkiObjects() throws Exception {
        final InstantWithoutNanos unreachableSince = InstantWithoutNanos.now().minus(cleanupGraceDuration);
        final Pair<Long, Long> deleted = Time.timed(() -> rpkiObjects.deleteUnreachableObjects(unreachableSince));
        log.info("Removed {} RPKI objects that have not been marked reachable since {}, took {}ms", deleted.getLeft(), unreachableSince, deleted.getRight());
        storage.gc();
        return deleted.getLeft();
    }

    public  RpkiObjectCleanupService(@Value("${rpki.validator.rpki.object.cleanup.grace.duration}") String cleanupGraceDuration,
                                    Storage storage);

}