From 345bc47df1039937cc753d055015f4844ca16e62 Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 7 Feb 2023 15:23:25 +0100 Subject: [PATCH] feat: lastCounter --- src/counter.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/counter.js b/src/counter.js index 05c5aaa..aacc15c 100644 --- a/src/counter.js +++ b/src/counter.js @@ -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; };