Optimize sync slightly

pull/770/head^2
Zef Hemel 2024-03-11 20:56:29 +01:00
parent 73e5bb6672
commit 0959a37a83
2 changed files with 3 additions and 4 deletions

View File

@ -20,8 +20,6 @@ export async function ensureSpaceIndex(ds: DataStore, system: System<any>) {
console.info("Full space index complete.");
await markFullSpaceIndexComplete(ds);
indexOngoing = false;
} else {
console.info("Space index is up to date");
}
}

View File

@ -255,7 +255,7 @@ export class Client {
this.syncService.start();
// 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) => {
// console.log("Operations", operations);
@ -275,7 +275,7 @@ export class Client {
ensureSpaceIndex(this.stateDataStore, this.clientSystem.system).catch(
console.error,
);
} else {
} else { // initialSync
// Let's load space scripts, which probably weren't loaded before
await this.clientSystem.loadSpaceScripts();
console.log(
@ -284,6 +284,7 @@ export class Client {
ensureSpaceIndex(this.stateDataStore, this.clientSystem.system).catch(
console.error,
);
initialSync = false;
}
}
if (operations) {