mirror of https://github.com/vector-im/riot-web
EventIndex: Move the checkpoint loading logic into the init method.
The checkpoints don't seem to be loaded anymore in the onSync method, the reason why this has stopped working is left unexplored since loading the checkpoints makes most sense during the initialization step anyways.pull/21833/head
parent
4039d60a43
commit
21a15fdcb4
|
@ -35,7 +35,12 @@ export default class EventIndex {
|
|||
|
||||
async init() {
|
||||
const indexManager = PlatformPeg.get().getEventIndexingManager();
|
||||
|
||||
await indexManager.initEventIndex();
|
||||
console.log("EventIndex: Successfully initialized the event index");
|
||||
|
||||
this.crawlerCheckpoints = await indexManager.loadCheckpoints();
|
||||
console.log("EventIndex: Loaded checkpoints", this.crawlerCheckpoints);
|
||||
|
||||
this.registerListeners();
|
||||
}
|
||||
|
@ -62,14 +67,6 @@ export default class EventIndex {
|
|||
onSync = async (state, prevState, data) => {
|
||||
const indexManager = PlatformPeg.get().getEventIndexingManager();
|
||||
|
||||
if (prevState === null && state === "PREPARED") {
|
||||
// Load our stored checkpoints, if any.
|
||||
this.crawlerCheckpoints = await indexManager.loadCheckpoints();
|
||||
console.log("EventIndex: Loaded checkpoints",
|
||||
this.crawlerCheckpoints);
|
||||
return;
|
||||
}
|
||||
|
||||
if (prevState === "PREPARED" && state === "SYNCING") {
|
||||
const addInitialCheckpoints = async () => {
|
||||
const client = MatrixClientPeg.get();
|
||||
|
|
|
@ -55,8 +55,6 @@ class EventIndexPeg {
|
|||
return false;
|
||||
}
|
||||
|
||||
console.log("EventIndex: Successfully initialized the event index");
|
||||
|
||||
this.index = index;
|
||||
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue