public void checkRetention() {
        taskContextFactory.current().info(() -> "Checking index shard retention");
        securityContext.secure(AppPermission.MANAGE_INDEX_SHARDS_PERMISSION, () -> {
            final FindIndexShardCriteria criteria = FindIndexShardCriteria.matchAll();
            criteria.getNodeNameSet().add(nodeInfo.getThisNodeName());
            final ResultPage<IndexShard> shards = indexShardDao.find(criteria);
            for (final IndexShard shard : shards.getValues()) {
                checkRetention(shard);
            }
        });
    }
Delete anything that has been marked to delete
stroom-index/stroom-index-impl/src/main/java/stroom/index/impl/IndexShardManager.java