class DefectService {

    boolean needFullIndexing(Long projectId, Date now) {
        // Refresh all defect statuses at startup,
        // to avoid any delta, handle deleted defects and to set the SINCE for next incremental indexing
        // + full index every hour to handle deleted defects
        return lastFullIndexDates.get(projectId) == null ||
                lastIncrementalIndexDates.get(projectId) == null ||
                diffHours(now, lastFullIndexDates.get(projectId)) >= 1;
    }

}