Review Bot
Auto-fix
Responded 2 minutes ago
Extracted batch size to RECONCILE_BATCH_SIZE in config and added a 5s per-batch transaction timeout. Updated PR pushed.
- const BATCH = 100;
+ const BATCH = config.RECONCILE_BATCH_SIZE;
for (let i = 0; i < rows.length; i += BATCH) {
- await this.db.transaction(async (tx) => {
+ await this.db.transaction(async (tx) => {
+ tx.setTimeout(5000);
const chunk = rows.slice(i, i + BATCH);