Project

General

Profile

« Previous | Next » 

Revision 60810

[Trunk | Notificaton Service]:
1. NotificationConfiguration.java: [Bug fix] Commented @PropertySources (a library service should not set properties locally, but parent service is responsible for that).
2. NotificationController.java: For method "getAllNotifications()" (/all), set @PreAuthorize to PORTAL_ADMIN (instead of REGISTERED_USER) (used for testing).
3. NotificationService.java: Comment @Scheduled(cron = "0 0 0 1/1 * ?") method "deleteNotifications()" and never delete old notifications.
4. notification.properties: Commented properties - set in dnet-override.properties file.

View differences:

NotificationService.java
72 72
        notificationDAO.delete(id);
73 73
    }
74 74

  
75
    // every min for testing
76
    //@Scheduled(cron = "0 * * * * *"
77
    // every day at midnight
78
    @Scheduled(cron = "0 0 0 1/1 * ?")
79
    protected void deleteNotifications() {
80
        logger.info("Deleting notifications that have been created more than a week ago");
81
        Calendar calendar = Calendar.getInstance();
82
        calendar.add(Calendar.DAY_OF_MONTH, -7);
83
        List<Notification> notifications = notificationDAO.findByDateBefore(calendar.getTime());
84
        notifications.forEach(notification -> {
85
            delete(notification.getId());
86
        });
87
    }
75
//    // every min for testing
76
//    //@Scheduled(cron = "0 * * * * *"
77
//    // every day at midnight
78
//    @Scheduled(cron = "0 0 0 1/1 * ?")
79
//    protected void deleteNotifications() {
80
//        logger.info("Deleting notifications that have been created more than a week ago");
81
//        Calendar calendar = Calendar.getInstance();
82
//        calendar.add(Calendar.DAY_OF_MONTH, -7);
83
//        List<Notification> notifications = notificationDAO.findByDateBefore(calendar.getTime());
84
//        notifications.forEach(notification -> {
85
//            delete(notification.getId());
86
//        });
87
//    }
88 88
}

Also available in: Unified diff