Skip to content

Commit 3d0e283

Browse files
committed
fix: fix update count detection.
1 parent 34a5161 commit 3d0e283

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

roomy-pages-backup/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,19 +118,19 @@ leaf.on("authenticated", async () => {
118118

119119
const batchSize = 2000;
120120
let offset = latestEvent + 1;
121+
let updates = 0;
121122
while (true) {
122123
const rawEvents = await leaf.fetchEvents(leafStream, {
123124
offset,
124125
limit: batchSize,
125126
});
126127
if (rawEvents.length == 0) break;
127128

128-
await materializeEvents(rawEvents);
129+
updates += await materializeEvents(rawEvents);
129130

130131
offset = rawEvents[rawEvents.length - 1].idx + 1;
131132
}
132133

133-
let updates = 0;
134134
while (backfillQueue.length > 0) {
135135
const events = [...backfillQueue];
136136
backfillQueue = [];

0 commit comments

Comments
 (0)