+8
web/src/lib/atproto.ts
+8
web/src/lib/atproto.ts
···
60
61
/**
62
* fetches up to 2000 uptime check records using cursor pagination with progress callback
63
*
64
* @param pds the PDS URL
65
* @param did the DID or handle to fetch records for
···
88
if (onProgress) {
89
onProgress(allRecords);
90
}
91
} while (cursor && totalFetched < maxRecords);
92
93
return allRecords;
···
60
61
/**
62
* fetches up to 2000 uptime check records using cursor pagination with progress callback
63
+
* stops early if no more records are available
64
*
65
* @param pds the PDS URL
66
* @param did the DID or handle to fetch records for
···
89
if (onProgress) {
90
onProgress(allRecords);
91
}
92
+
93
+
// Stop early if we got fewer records than the batch size (indicating we've exhausted all records)
94
+
// or if no cursor is returned (also indicating no more records)
95
+
if (newRecords.length < batchSize || !cursor) {
96
+
break;
97
+
}
98
+
99
} while (cursor && totalFetched < maxRecords);
100
101
return allRecords;