Lots of re-structuring and handling of different data types
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user