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