Skip to content

Commit

Permalink
perf(config): Reduce delay between property processing batches to 2s
Browse files Browse the repository at this point in the history
  • Loading branch information
csulit committed Oct 25, 2024
1 parent 7f6e850 commit 489b1f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config/deno-kv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -485,12 +485,12 @@ export async function listenQueue(kv: Deno.Kv) {
}
};

// Process 2 properties at a time with 5s delay between batches
// Process 2 properties at a time with 2s delay between batches
for (let i = 0; i < property.rows.length; i += 2) {
const batch = property.rows.slice(i, i + 2);
await Promise.all(batch.map(processProperty));
if (i + 2 < property.rows.length) {
await new Promise((resolve) => setTimeout(resolve, 5000));
await new Promise((resolve) => setTimeout(resolve, 2000));
}
}

Expand Down

0 comments on commit 489b1f1

Please sign in to comment.