private int deletingOldProcessorFilters(final Instant deleteThreshold) {
        final Set<String> procFilterUuids = processorFilterDao.physicalDeleteOldProcessorFilters(deleteThreshold);

        if (!procFilterUuids.isEmpty()) {
            // Now delete any perms for the deleted filters
            LOGGER.debug(() -> LogUtil.message("Deleting doc_permission records for {} doc UUIDs",
                    procFilterUuids.size()));
            final Set<DocRef> docRefs = procFilterUuids
                    .stream()
                    .map(uuid -> new DocRef(ProcessorFilter.ENTITY_TYPE, uuid))
                    .collect(Collectors.toSet());
            documentPermissionService.removeAllDocumentPermissions(docRefs);
        }

        return procFilterUuids.size();
    }
Synchronised as we don't want to run more than once concurrently.
stroom-processor/stroom-processor-impl-db/src/main/java/stroom/processor/impl/db/ProcessorTaskDeleteExecutorImpl.java