mirror of
https://github.com/openmhz/trunk-server.git
synced 2026-11-13 17:27:37 -05:00
drop freqlist and start collecting errorCount
This commit is contained in:
@@ -234,7 +234,6 @@ function package_call(item) {
|
|||||||
name: item.name,
|
name: item.name,
|
||||||
freq: item.freq,
|
freq: item.freq,
|
||||||
srcList: item.srcList,
|
srcList: item.srcList,
|
||||||
freqList: item.freqList,
|
|
||||||
star: item.star,
|
star: item.star,
|
||||||
len: Math.round(item.len)
|
len: Math.round(item.len)
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -126,22 +126,10 @@ exports.upload = function (req, res, next) {
|
|||||||
// Add in an API Key check
|
// Add in an API Key check
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
var srcList = JSON.parse(req.body.source_list);
|
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) {
|
} catch (err) {
|
||||||
var srcList = [];
|
var srcList = [];
|
||||||
var freqList = [];
|
|
||||||
console.warn("[" + req.params.shortName + "] Error /:shortName/upload Parsing Source/Freq List - Error: " + err);
|
console.warn("[" + req.params.shortName + "] Error /:shortName/upload Parsing Source/Freq List - Error: " + err);
|
||||||
|
|
||||||
res.status(500);
|
res.status(500);
|
||||||
res.send("Error parsing sourcelist " + err);
|
res.send("Error parsing sourcelist " + err);
|
||||||
}
|
}
|
||||||
@@ -173,7 +161,6 @@ exports.upload = function (req, res, next) {
|
|||||||
emergency: emergency,
|
emergency: emergency,
|
||||||
path: local_path,
|
path: local_path,
|
||||||
srcList: srcList,
|
srcList: srcList,
|
||||||
freqList: freqList,
|
|
||||||
len: -1
|
len: -1
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ var callSchema = mongoose.Schema({
|
|||||||
time: Date,
|
time: Date,
|
||||||
name: String,
|
name: String,
|
||||||
freq: Number,
|
freq: Number,
|
||||||
|
errorCount: Number,
|
||||||
|
spikeCount: Number,
|
||||||
url: String,
|
url: String,
|
||||||
emergency: Boolean,
|
emergency: Boolean,
|
||||||
path: String,
|
path: String,
|
||||||
@@ -21,8 +23,7 @@ var callSchema = mongoose.Schema({
|
|||||||
type: Number,
|
type: Number,
|
||||||
default: 0
|
default: 0
|
||||||
},
|
},
|
||||||
srcList: [srcSchema],
|
srcList: [srcSchema]
|
||||||
freqList: [freqSchema]
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ var spots = (24*60) / timePeriod; // the number of spots needed to keep track of
|
|||||||
|
|
||||||
function updateActiveSystems() {
|
function updateActiveSystems() {
|
||||||
|
|
||||||
// Go through all of the Syste,s
|
// Go through all of the Systems
|
||||||
db.get().collection('systems', function(err, sysCollection) {
|
db.get().collection('systems', function(err, sysCollection) {
|
||||||
var cursor = sysCollection.find();
|
var cursor = sysCollection.find();
|
||||||
cursor.each(function(err, item) {
|
cursor.each(function(err, item) {
|
||||||
|
|||||||
Reference in New Issue
Block a user