Tags redo (#624)

Introduction of `tag` and `itags`
This commit is contained in:
Zef Hemel
2024-01-11 13:20:50 +01:00
committed by GitHub
parent 9a07c4c90a
commit 848211120c
31 changed files with 286 additions and 170 deletions
+5 -13
View File
@@ -33,6 +33,7 @@ import { CodeWidgetHook } from "../web/hooks/code_widget.ts";
import { KVPrimitivesManifestCache } from "../plugos/manifest_cache.ts";
import { KvPrimitives } from "../plugos/lib/kv_primitives.ts";
import { ShellBackend } from "./shell_backend.ts";
import { ensureSpaceIndex } from "../common/space_index.ts";
const fileListInterval = 30 * 1000; // 30s
@@ -161,19 +162,10 @@ export class ServerSystem {
})().catch(console.error);
});
// Check if this space was ever indexed before
if (!await this.ds.get(["$initialIndexDone"])) {
console.log("Indexing space for the first time (in the background)");
const indexPromise = this.system.loadedPlugs.get("index")!.invoke(
"reindexSpace",
[],
).then(() => {
console.log("Initial index completed!");
this.ds.set(["$initialIndexDone"], true);
}).catch(console.error);
if (awaitIndex) {
await indexPromise;
}
// Ensure a valid index
const indexPromise = ensureSpaceIndex(this.ds, this.system);
if (awaitIndex) {
await indexPromise;
}
await eventHook.dispatchEvent("system:ready");