EventIndexing: Fix a typo.

pull/21833/head
Damir Jelić 2019-11-13 15:57:12 +01:00
parent bf558b46c3
commit c26df9d9ef
1 changed files with 10 additions and 10 deletions

View File

@ -22,7 +22,7 @@ import MatrixClientPeg from "./MatrixClientPeg";
*/ */
export default class EventIndexer { export default class EventIndexer {
constructor() { constructor() {
this.crawlerChekpoints = []; this.crawlerCheckpoints = [];
// The time that the crawler will wait between /rooms/{room_id}/messages // The time that the crawler will wait between /rooms/{room_id}/messages
// requests // requests
this._crawler_timeout = 3000; this._crawler_timeout = 3000;
@ -43,9 +43,9 @@ export default class EventIndexer {
if (prevState === null && state === "PREPARED") { if (prevState === null && state === "PREPARED") {
// Load our stored checkpoints, if any. // Load our stored checkpoints, if any.
this.crawlerChekpoints = await indexManager.loadCheckpoints(); this.crawlerCheckpoints = await indexManager.loadCheckpoints();
console.log("EventIndex: Loaded checkpoints", console.log("EventIndex: Loaded checkpoints",
this.crawlerChekpoints); this.crawlerCheckpoints);
return; return;
} }
@ -87,8 +87,8 @@ export default class EventIndexer {
await indexManager.addCrawlerCheckpoint(backCheckpoint); await indexManager.addCrawlerCheckpoint(backCheckpoint);
await indexManager.addCrawlerCheckpoint(forwardCheckpoint); await indexManager.addCrawlerCheckpoint(forwardCheckpoint);
this.crawlerChekpoints.push(backCheckpoint); this.crawlerCheckpoints.push(backCheckpoint);
this.crawlerChekpoints.push(forwardCheckpoint); this.crawlerCheckpoints.push(forwardCheckpoint);
})); }));
}; };
@ -199,7 +199,7 @@ export default class EventIndexer {
break; break;
} }
const checkpoint = this.crawlerChekpoints.shift(); const checkpoint = this.crawlerCheckpoints.shift();
/// There is no checkpoint available currently, one may appear if /// There is no checkpoint available currently, one may appear if
// a sync with limited room timelines happens, so go back to sleep. // a sync with limited room timelines happens, so go back to sleep.
@ -222,7 +222,7 @@ export default class EventIndexer {
checkpoint.direction); checkpoint.direction);
} catch (e) { } catch (e) {
console.log("EventIndex: Error crawling events:", e); console.log("EventIndex: Error crawling events:", e);
this.crawlerChekpoints.push(checkpoint); this.crawlerCheckpoints.push(checkpoint);
continue; continue;
} }
@ -334,13 +334,13 @@ export default class EventIndexer {
"added, stopping the crawl", checkpoint); "added, stopping the crawl", checkpoint);
await indexManager.removeCrawlerCheckpoint(newCheckpoint); await indexManager.removeCrawlerCheckpoint(newCheckpoint);
} else { } else {
this.crawlerChekpoints.push(newCheckpoint); this.crawlerCheckpoints.push(newCheckpoint);
} }
} catch (e) { } catch (e) {
console.log("EventIndex: Error durring a crawl", e); console.log("EventIndex: Error durring a crawl", e);
// An error occured, put the checkpoint back so we // An error occured, put the checkpoint back so we
// can retry. // can retry.
this.crawlerChekpoints.push(checkpoint); this.crawlerCheckpoints.push(checkpoint);
} }
} }
@ -367,7 +367,7 @@ export default class EventIndexer {
await indexManager.addCrawlerCheckpoint(backwardsCheckpoint); await indexManager.addCrawlerCheckpoint(backwardsCheckpoint);
this.crawlerChekpoints.push(backwardsCheckpoint); this.crawlerCheckpoints.push(backwardsCheckpoint);
} }
async deleteEventIndex() { async deleteEventIndex() {