class ExecutionService {

    public void requestCompletion(long projectId, String jobUrl) {
        final Execution execution = executionRepository.findByProjectIdAndJobUrl(projectId, jobUrl);

        // Cycle-run not indexed yet OR not done yet (will never be crawled again if done: we have the definitive data)
        if (execution == null || execution.getStatus() != JobStatus.DONE) {
            // The flag is in a separate table (and not an execution column) for two reasons:
            // * The execution may not be crawled yet, so no row in database (severe enough if it was a column ;-) )
            // * A crawling might be in progress (with NOT up to date data) while setting the flag, and the crawling save would update the whole execution row, removing the flag before the next crawling would have a chance to run with the complete data (resulting in a non-definitive quality-status report meanwhile)
            executionCompletionRequestRepository.save(new ExecutionCompletionRequest(jobUrl));
        }
    }

}