2016-05-24 23:32:04 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
angular.module('ffffng').factory('MonitoringMailsSendingJob', function (MonitoringService, Logger) {
|
|
|
|
return {
|
2016-06-21 14:55:02 +02:00
|
|
|
description: 'Sends monitoring emails depending on the monitoring state of nodes retrieved by the NodeInformationRetrievalJob.',
|
|
|
|
|
2016-06-03 23:42:17 +02:00
|
|
|
run: function (callback) {
|
2016-05-24 23:32:04 +02:00
|
|
|
MonitoringService.sendMonitoringMails(function (err) {
|
|
|
|
if (err) {
|
|
|
|
Logger.tag('monitoring', 'mail-sending').error('Error sending monitoring mails:', err);
|
|
|
|
}
|
2016-06-03 23:42:17 +02:00
|
|
|
|
|
|
|
callback();
|
2016-05-24 23:32:04 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
});
|