mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-15 08:11:29 +03:00
Increase eventsPerCrawl for larger chunks and rely on chunk's length for crawled events size
This commit is contained in:
parent
6160b11eb8
commit
80e5d4cd77
1 changed files with 2 additions and 2 deletions
|
@ -56,12 +56,12 @@ export default abstract class Exporter {
|
|||
let events: MatrixEvent[] = [];
|
||||
|
||||
while (limit) {
|
||||
const eventsPerCrawl = Math.min(limit, 100);
|
||||
const eventsPerCrawl = Math.min(limit, 1000);
|
||||
const res: any = await client.createMessagesRequest(this.room.roomId, prevToken, eventsPerCrawl, "b");
|
||||
|
||||
if (res.chunk.length === 0) break;
|
||||
|
||||
limit -= eventsPerCrawl;
|
||||
limit -= res.chunk.length;
|
||||
|
||||
const matrixEvents: MatrixEvent[] = res.chunk.map(eventMapper);
|
||||
|
||||
|
|
Loading…
Reference in a new issue