Lots of re-structuring and handling of different data types

This commit is contained in:
Joe
2019-01-18 15:29:21 -06:00
parent e1007f8ed9
commit b0d5fca2a4
8 changed files with 51 additions and 27 deletions

View File

@@ -45,20 +45,15 @@ function cb(){
theMessage.processingType=processingType;
theMessage.sourceTag=config.sourceTag;
theMessage.timestamp=new Date();
theDiskLimit.isWarn=false;
disk.check(theDiskLimit.path, function(err, info) {
if (err) {
logger.log("error","Error reading disk Information " + err);
theDiskLimit.error = err;
theDiskLimit.isWarn = true;
} else {
let availGB=info.available/1024/1024;
let totalGB=info.total/1024/1024;
theDiskLimit.availGB=availGB;
theDiskLimit.totalGB=totalGB;
if (availGB<=theDiskLimit.minFree) {
theDiskLimit.isWarn=true;
}
}
theMessage.data=theDiskLimit;
logger.log("debug","Sending Message: " + JSON.stringify(theMessage));