From 80e5d4cd77686af850e69a3fce2a5e19bdb59d63 Mon Sep 17 00:00:00 2001 From: Jaiwanth Date: Thu, 10 Jun 2021 11:53:41 +0530 Subject: [PATCH] Increase eventsPerCrawl for larger chunks and rely on chunk's length for crawled events size --- src/utils/exportUtils/Exporter.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/exportUtils/Exporter.ts b/src/utils/exportUtils/Exporter.ts index 270669374b..36494e13ef 100644 --- a/src/utils/exportUtils/Exporter.ts +++ b/src/utils/exportUtils/Exporter.ts @@ -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);