feat: lastCounter
gitea/vn-rfid/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2023-02-07 15:23:25 +01:00
parent 17b8ee9194
commit 345bc47df1
1 changed files with 4 additions and 0 deletions

View File

@ -1,10 +1,14 @@
import con from '../db/connect.js';
let lastCounter;
export default async(size, arcId) => {
if (lastCounter == size) return;
console.logger.info(`COUNTER: SIZE:${size} ARC_ID:${arcId}`);
await con.query(`
UPDATE vn.arcRead
SET counter = ?
WHERE id = ?;
`, [size, arcId]);
lastCounter = size;
};