mirror of
https://github.com/openmhz/trunk-server.git
synced 2026-11-12 00:37:29 -05:00
drop freqlist and start collecting errorCount
This commit is contained in:
@@ -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)
|
||||
};
|
||||
|
||||
@@ -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
|
||||
});
|
||||
|
||||
|
||||
@@ -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]
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user