Skip to content

Commit

Permalink
chore: only log if non-zero
Browse files Browse the repository at this point in the history
  • Loading branch information
rorlic committed Dec 9, 2024
1 parent 5fdfa3a commit bc4aaa5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/db-migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,15 @@ async function processMembers(collection: Collection<Member>) {
const endTime = new Date().getTime();

const count = members.length;
console.log(`Cursor returned ${count} members in ${endTime - startTime} ms`);
if (count) console.log(`Cursor returned ${count} members in ${endTime - startTime} ms`);

for (let index = 0; index < members.length; index++) {
const x = members[index]!;
await producer.send({ topic: kafkaTopic, messages: [{ value: x.model }] });
lastSequenceNr = x.sequenceNr;
};
const sendTime = new Date().getTime();
console.log(`Send ${count} members in ${sendTime - endTime} ms`);
if (count) console.log(`Send ${count} members in ${sendTime - endTime} ms`);

total += count;
done = (count < chunkSize);
Expand Down

0 comments on commit bc4aaa5

Please sign in to comment.