Job to automatically delete nodes after 100 days.

This commit is contained in:
baldo 2016-07-29 23:09:43 +02:00
commit 6aac4af80f
4 changed files with 74 additions and 34 deletions

View file

@ -0,0 +1,17 @@
'use strict';
angular.module('ffffng').factory('OfflineNodesDeletionJob', function (MonitoringService, Logger) {
return {
description: 'Delete nodes that are offline for more than 100 days.',
run: function (callback) {
MonitoringService.deleteOfflineNodes(function (err) {
if (err) {
Logger.tag('nodes', 'delete-offline').error('Error deleting offline nodes:', err);
}
callback();
});
}
};
});