override status for broken status

This commit is contained in:
DJ2LS 2023-05-27 06:54:02 +02:00
parent ccdb206dbb
commit 6a739d652b

View file

@ -1029,6 +1029,21 @@ if (typeof obj.percent == "undefined") {
obj.bytesperminute = 0;
}
// check if wrong status message
if (obj.status == "transmit" && obj.percent == 0) {
var TimeDifference = (new Date().getTime()/1000) - obj.timestamp
if (TimeDifference > 3600){
db.upsert(obj._id, function (doc) {
if (!doc.status) {
doc.status = "failed";
}
return doc;
});
obj.status = "failed";
}
}
if (typeof config.max_retry_attempts == "undefined") {
var max_retry_attempts = 3;
} else {