Source:
<code>protected synchronized void processSpool(long processCutoffTime) { logger.debug("Processing signal spool"); try { List<EventSignalSpool> spools = this.signalSpoolDao.findAllDue(); List<String> spoolsToDelete = new ArrayList<String>(spools.size()); for (EventSignalSpool spool : spools) { EventSummary eventSummary = this.eventSummaryDao.findByUuid(spool.getEventSummaryUuid()); EventStatus status = (eventSummary != null) ? eventSummary.getStatus() : null; <START> if (!OPEN_STATUSES.contains(status) || status == EventStatus.STATUS_ACKNOWLEDGED) { <END> spoolsToDelete.add(spool.getUuid()); continue; } EventTriggerSubscription trSub = this.eventTriggerSubscriptionDao .findByUuid(spool.getSubscriptionUuid()); if (trSub == null) { logger.debug("Current spool entry no longer valid (subscription deleted), skipping: {}", spool.getUuid()); continue; } EventTrigger trigger = this.triggerDao.findByUuid(trSub.getTriggerUuid()); if (trigger == null) { logger.debug("Current spool entry no longer valid (trigger deleted), skipping: {}", spool.getUuid()); continue; } if (trigger.getEnabled()) { publishSignal(eventSummary, trSub); if (!spool.isSentSignal()) { spool.setSentSignal(true); } } int repeatInterval = trSub.getRepeatSeconds(); boolean onlySendInitial = trSub.getSendInitialOccurrence(); if (!onlySendInitial && repeatInterval > 0) { long nextFlush = processCutoffTime + TimeUnit.SECONDS.toMillis(repeatInterval); spool.setFlushTime(nextFlush); } else { spool.setFlushTime(Long.MAX_VALUE); } this.signalSpoolDao.update(spool); } if (!spoolsToDelete.isEmpty()) { this.signalSpoolDao.delete(spoolsToDelete); } } catch (Exception e) { logger.warn("Failed to process signal spool", e); } }</code><technical_language>I wondering if trigger fires based event status better? I if another customer surprised acknowledged events longer fire event triggers</technical_language>

Target:
protected synchronized void processSpool(long processCutoffTime) { logger.debug("Processing signal spool"); try { List<EventSignalSpool> spools = this.signalSpoolDao.findAllDue(); List<String> spoolsToDelete = new ArrayList<String>(spools.size()); for (EventSignalSpool spool : spools) { EventSummary eventSummary = this.eventSummaryDao.findByUuid(spool.getEventSummaryUuid()); EventStatus status = (eventSummary != null) ? eventSummary.getStatus() : null; if (!OPEN_STATUSES.contains(status)) { spoolsToDelete.add(spool.getUuid()); continue; } EventTriggerSubscription trSub = this.eventTriggerSubscriptionDao .findByUuid(spool.getSubscriptionUuid()); if (trSub == null) { logger.debug("Current spool entry no longer valid (subscription deleted), skipping: {}", spool.getUuid()); continue; } EventTrigger trigger = this.triggerDao.findByUuid(trSub.getTriggerUuid()); if (trigger == null) { logger.debug("Current spool entry no longer valid (trigger deleted), skipping: {}", spool.getUuid()); continue; } if (trigger.getEnabled()) { publishSignal(eventSummary, trSub); if (!spool.isSentSignal()) { spool.setSentSignal(true); } } int repeatInterval = trSub.getRepeatSeconds(); if (repeatInterval > 0 && OPEN_STATUSES.contains(status) && status != EventStatus.STATUS_ACKNOWLEDGED) { long nextFlush = processCutoffTime + TimeUnit.SECONDS.toMillis(repeatInterval); spool.setFlushTime(nextFlush); } else { spool.setFlushTime(Long.MAX_VALUE); } this.signalSpoolDao.update(spool); } if (!spoolsToDelete.isEmpty()) { this.signalSpoolDao.delete(spoolsToDelete); } } catch (Exception e) { logger.warn("Failed to process signal spool", e); } }