diff --git a/api/controllers/ApiController.js b/api/controllers/ApiController.js index 82357cd..0e79068 100644 --- a/api/controllers/ApiController.js +++ b/api/controllers/ApiController.js @@ -61,6 +61,7 @@ const db = makeDb(config); var currentIn = []; var currentOut = []; +var maxCompare = 5; exports.SaveLogs = async function (req, res) { @@ -125,13 +126,13 @@ exports.SaveLogs = async function (req, res) { } if (canSaveLogs) { if (req.body.type === "in") { - if (currentIn.length >= 10) { + if (currentIn.length >= maxCompare) { currentIn.shift(); } currentIn.push({"plate": req.body.plate, "time": currentTimestamp}); } if (req.body.type === "out") { - if (currentOut.length >= 10) { + if (currentOut.length >= maxCompare) { currentOut.shift(); } currentOut.push({"plate": req.body.plate, "time": currentTimestamp});