drop freqlist and start collecting errorCount

This commit is contained in:
Luke Berndt
2023-04-06 10:30:06 -04:00
parent fcee871373
commit 6b2f7fbffd
4 changed files with 4 additions and 17 deletions

View File

@@ -234,7 +234,6 @@ function package_call(item) {
name: item.name,
freq: item.freq,
srcList: item.srcList,
freqList: item.freqList,
star: item.star,
len: Math.round(item.len)
};

View File

@@ -126,22 +126,10 @@ exports.upload = function (req, res, next) {
// Add in an API Key check
try {
var srcList = JSON.parse(req.body.source_list);
// Mongoose does not allow 'errors' to be used in the Schema for call. need to rename to error.
var badFreqList = JSON.parse(req.body.freq_list);
var freqList = badFreqList.map(obj => {
obj.error = obj.errors;
delete obj.errors;
return obj;
});
} catch (err) {
var srcList = [];
var freqList = [];
console.warn("[" + req.params.shortName + "] Error /:shortName/upload Parsing Source/Freq List - Error: " + err);
res.status(500);
res.send("Error parsing sourcelist " + err);
}
@@ -173,7 +161,6 @@ exports.upload = function (req, res, next) {
emergency: emergency,
path: local_path,
srcList: srcList,
freqList: freqList,
len: -1
});

View File

@@ -13,6 +13,8 @@ var callSchema = mongoose.Schema({
time: Date,
name: String,
freq: Number,
errorCount: Number,
spikeCount: Number,
url: String,
emergency: Boolean,
path: String,
@@ -21,8 +23,7 @@ var callSchema = mongoose.Schema({
type: Number,
default: 0
},
srcList: [srcSchema],
freqList: [freqSchema]
srcList: [srcSchema]
});

View File

@@ -9,7 +9,7 @@ var spots = (24*60) / timePeriod; // the number of spots needed to keep track of
function updateActiveSystems() {
// Go through all of the Syste,s
// Go through all of the Systems
db.get().collection('systems', function(err, sysCollection) {
var cursor = sysCollection.find();
cursor.each(function(err, item) {