Optimize sync slightly
parent
73e5bb6672
commit
0959a37a83
|
@ -20,8 +20,6 @@ export async function ensureSpaceIndex(ds: DataStore, system: System<any>) {
|
||||||
console.info("Full space index complete.");
|
console.info("Full space index complete.");
|
||||||
await markFullSpaceIndexComplete(ds);
|
await markFullSpaceIndexComplete(ds);
|
||||||
indexOngoing = false;
|
indexOngoing = false;
|
||||||
} else {
|
|
||||||
console.info("Space index is up to date");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -255,7 +255,7 @@ export class Client {
|
||||||
this.syncService.start();
|
this.syncService.start();
|
||||||
|
|
||||||
// We're still booting, if a initial sync has already been completed we know this is the initial sync
|
// We're still booting, if a initial sync has already been completed we know this is the initial sync
|
||||||
const initialSync = !await this.syncService.hasInitialSyncCompleted();
|
let initialSync = !await this.syncService.hasInitialSyncCompleted();
|
||||||
|
|
||||||
this.eventHook.addLocalListener("sync:success", async (operations) => {
|
this.eventHook.addLocalListener("sync:success", async (operations) => {
|
||||||
// console.log("Operations", operations);
|
// console.log("Operations", operations);
|
||||||
|
@ -275,7 +275,7 @@ export class Client {
|
||||||
ensureSpaceIndex(this.stateDataStore, this.clientSystem.system).catch(
|
ensureSpaceIndex(this.stateDataStore, this.clientSystem.system).catch(
|
||||||
console.error,
|
console.error,
|
||||||
);
|
);
|
||||||
} else {
|
} else { // initialSync
|
||||||
// Let's load space scripts, which probably weren't loaded before
|
// Let's load space scripts, which probably weren't loaded before
|
||||||
await this.clientSystem.loadSpaceScripts();
|
await this.clientSystem.loadSpaceScripts();
|
||||||
console.log(
|
console.log(
|
||||||
|
@ -284,6 +284,7 @@ export class Client {
|
||||||
ensureSpaceIndex(this.stateDataStore, this.clientSystem.system).catch(
|
ensureSpaceIndex(this.stateDataStore, this.clientSystem.system).catch(
|
||||||
console.error,
|
console.error,
|
||||||
);
|
);
|
||||||
|
initialSync = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (operations) {
|
if (operations) {
|
||||||
|
|
Loading…
Reference in New Issue