Admin: Add message with failed / total nodes for nodes.json-task.
This commit is contained in:
parent
fb87695b3e
commit
b6a67d6e74
12 changed files with 120 additions and 20 deletions
server/jobs
|
@ -1,8 +1,20 @@
|
|||
import * as MonitoringService from "../services/monitoringService";
|
||||
import {jobResultOkay, jobResultWarning} from "./scheduler";
|
||||
|
||||
export default {
|
||||
name: 'NodeInformationRetrievalJob',
|
||||
description: 'Fetches the nodes.json and calculates and stores the monitoring / online status for registered nodes.',
|
||||
|
||||
run: MonitoringService.retrieveNodeInformation,
|
||||
async run () {
|
||||
const result = await MonitoringService.retrieveNodeInformation();
|
||||
if (result.failedParsingNodesCount > 0) {
|
||||
return jobResultWarning(
|
||||
`Warning: ${result.failedParsingNodesCount} of ${result.totalNodesCount} nodes could not be processed.`
|
||||
);
|
||||
} else {
|
||||
return jobResultOkay(
|
||||
`${result.totalNodesCount} nodes have been processed.`
|
||||
);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue