From 5aa645caf9401b4e53d006604dd7a223d4a368e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Tue, 5 May 2020 10:10:21 +0200 Subject: [PATCH 1/2] EventIndex: Reduce the logging the event index is producing. --- src/indexing/EventIndex.js | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/src/indexing/EventIndex.js b/src/indexing/EventIndex.js index a6bbbb5f96..eed9837a7a 100644 --- a/src/indexing/EventIndex.js +++ b/src/indexing/EventIndex.js @@ -102,9 +102,6 @@ export default class EventIndex extends EventEmitter { const timeline = room.getLiveTimeline(); const token = timeline.getPaginationToken("b"); - console.log("EventIndex: Got token for indexer", - room.roomId, token); - const backCheckpoint = { roomId: room.roomId, token: token, @@ -161,7 +158,6 @@ export default class EventIndex extends EventEmitter { if (prevState === "SYNCING" && state === "SYNCING") { // A sync was done, presumably we queued up some live events, // commit them now. - console.log("EventIndex: Committing events"); await indexManager.commitLiveEvents(); return; } @@ -336,8 +332,6 @@ export default class EventIndex extends EventEmitter { async crawlerFunc() { let cancelled = false; - console.log("EventIndex: Started crawler function"); - const client = MatrixClientPeg.get(); const indexManager = PlatformPeg.get().getEventIndexingManager(); @@ -366,8 +360,6 @@ export default class EventIndex extends EventEmitter { await sleep(sleepTime); - console.log("EventIndex: Running the crawler loop."); - if (cancelled) { break; } @@ -386,8 +378,6 @@ export default class EventIndex extends EventEmitter { idle = false; - console.log("EventIndex: crawling using checkpoint", checkpoint); - // We have a checkpoint, let us fetch some messages, again, very // conservatively to not bother our homeserver too much. const eventMapper = client.getEventMapper({preventReEmit: true}); @@ -511,15 +501,6 @@ export default class EventIndex extends EventEmitter { direction: checkpoint.direction, }; - console.log( - "EventIndex: Crawled room", - client.getRoom(checkpoint.roomId).name, - "and fetched total", matrixEvents.length, "events of which", - events.length, "are being added,", redactionEvents.length, - "are redacted,", matrixEvents.length - events.length, - "are being skipped, undecryptable", undecryptableEvents.length, - ); - try { for (let i = 0; i < redactionEvents.length; i++) { const ev = redactionEvents[i]; @@ -552,8 +533,6 @@ export default class EventIndex extends EventEmitter { } this._crawler = null; - - console.log("EventIndex: Stopping crawler function"); } /** From 51a79a43e3186838d02349ee3106d748ac8e71fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Tue, 5 May 2020 10:21:18 +0200 Subject: [PATCH 2/2] EventIndex: Remove an unused variable. --- src/indexing/EventIndex.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/indexing/EventIndex.js b/src/indexing/EventIndex.js index eed9837a7a..02151f8474 100644 --- a/src/indexing/EventIndex.js +++ b/src/indexing/EventIndex.js @@ -467,9 +467,6 @@ export default class EventIndex extends EventEmitter { // decryption keys, do we want to retry this checkpoint at a later // stage? const filteredEvents = matrixEvents.filter(this.isValidEvent); - const undecryptableEvents = matrixEvents.filter((ev) => { - return ev.isDecryptionFailure(); - }); // Collect the redaction events so we can delete the redacted events // from the index.