Job to automatically delete nodes after 100 days.
This commit is contained in:
parent
cacc3faeb5
commit
6aac4af80f
4 changed files with 74 additions and 34 deletions
17
server/jobs/offlineNodesDeletionJob.js
Normal file
17
server/jobs/offlineNodesDeletionJob.js
Normal 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();
|
||||
});
|
||||
}
|
||||
};
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue