urbanairship-core/src/main/java/com/urbanairship/automation/AutomationEngine.java
@WorkerThread
    private void cleanSchedules() {
        List<ScheduleEntry> expired = dataManager.getActiveExpiredScheduleEntries();
        List<ScheduleEntry> finished = dataManager.getScheduleEntries(ScheduleEntry.STATE_FINISHED);

        if (expired.isEmpty()) {
            handleExpiredEntries(expired);
        }

        Set<String> schedulesToDelete = new HashSet<>();

        for (ScheduleEntry entry : finished) {
            if (System.currentTimeMillis() >= entry.getExecutionStateChangeDate() + entry.getEditGracePeriod()) {
                schedulesToDelete.add(entry.scheduleId);
            }
        }

        if (!schedulesToDelete.isEmpty()) {
            Logger.verbose("AutomationEngine - Deleting finished schedules: " + schedulesToDelete);
            dataManager.deleteSchedules(schedulesToDelete);
        }
    }
/**
     * Expires active schedules past their end date and deletes finished schedules past the edit
     * grace period.
     */
Expires active schedules past their end date and deletes finished schedules past the edit
grace period.
Expires active schedules past their end date and deletes finished schedules past the edit grace period .
@WorkerThread
    private void cleanSchedules() {
        List<ScheduleEntry> expired = dataManager.getActiveExpiredScheduleEntries();
        List<ScheduleEntry> finished = dataManager.getScheduleEntries(ScheduleEntry.STATE_FINISHED);
        if (expired.isEmpty()) {
            handleExpiredEntries(expired);
        }
        Set<String> schedulesToDelete = new HashSet<>();
        for (ScheduleEntry entry : finished) {
            if (System.currentTimeMillis() >= entry.getExecutionStateChangeDate() + entry.getEditGracePeriod()) {
                schedulesToDelete.add(entry.scheduleId);
            }
        }
        if (!schedulesToDelete.isEmpty()) {
            Logger.verbose("AutomationEngine - Deleting finished schedules: " + schedulesToDelete);
            dataManager.deleteSchedules(schedulesToDelete);
        }
    }
@ WorkerThread private void cleanSchedules ( ) { List < ScheduleEntry > expired = dataManager . getActiveExpiredScheduleEntries ( ) ; List < ScheduleEntry > finished = dataManager . getScheduleEntries ( ScheduleEntry . STATE_FINISHED ) ; if ( expired . isEmpty ( ) ) { handleExpiredEntries ( expired ) ; } Set < String > schedulesToDelete = new HashSet < > ( ) ; for ( ScheduleEntry entry : finished ) { if ( System . currentTimeMillis ( ) >= entry . getExecutionStateChangeDate ( ) + entry . getEditGracePeriod ( ) ) { schedulesToDelete . add ( entry . scheduleId ) ; } } if ( ! schedulesToDelete . isEmpty ( ) ) { Logger . verbose ( "AutomationEngine - Deleting finished schedules: " + schedulesToDelete ) ; dataManager . deleteSchedules ( schedulesToDelete ) ; } }
Expires active schedules past their end date and deletes finished schedules past the edit
 grace period.
Expires active schedules past their end date and deletes finished schedules past the edit grace period .