From 206fd68d75b78d0cb7583eb045f1addf256de6a8 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Mon, 24 Jun 2024 06:01:10 +0000 Subject: [PATCH] only set on primary --- svc/scanner.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/svc/scanner.ts b/svc/scanner.ts index 486eea8dc..17490bfe0 100755 --- a/svc/scanner.ts +++ b/svc/scanner.ts @@ -45,7 +45,10 @@ async function scanApi(seqNum: number) { nextSeqNum = resp[resp.length - 1].match_seq_num + 1; console.log('next_seq_num: %s', nextSeqNum); } - await redis.set('match_seq_num', nextSeqNum); + if (!Number(config.SCANNER_OFFSET)) { + // Only set match seq num on primary + await redis.set('match_seq_num', nextSeqNum); + } // We might want to store this in pg eventually for consistency // await db.raw('INSERT INTO last_seq_num(match_seq_num) VALUES (?)', [nextSeqNum]); // If not a full page, delay the next iteration