Ensure reindex with space function indexers
parent
16d1d3265b
commit
0940eb1d15
|
@ -64,7 +64,7 @@ export async function plugRunCommand(
|
||||||
export async function runPlug(
|
export async function runPlug(
|
||||||
spacePath: string,
|
spacePath: string,
|
||||||
functionName: string | undefined,
|
functionName: string | undefined,
|
||||||
args: string[] = [],
|
args: any[] = [],
|
||||||
builtinAssetBundle: AssetBundle,
|
builtinAssetBundle: AssetBundle,
|
||||||
kvPrimitives: KvPrimitives,
|
kvPrimitives: KvPrimitives,
|
||||||
httpServerPort?: number,
|
httpServerPort?: number,
|
||||||
|
|
|
@ -100,7 +100,7 @@ export async function serveCommand(
|
||||||
const plugAssets = new AssetBundle(plugAssetBundle as AssetJson);
|
const plugAssets = new AssetBundle(plugAssetBundle as AssetJson);
|
||||||
|
|
||||||
if (readOnly) {
|
if (readOnly) {
|
||||||
console.log("Indexing the space first. Hang on...");
|
console.log("Performing initial space indexing...");
|
||||||
await runPlug(
|
await runPlug(
|
||||||
folder,
|
folder,
|
||||||
"index.reindexSpace",
|
"index.reindexSpace",
|
||||||
|
@ -108,6 +108,16 @@ export async function serveCommand(
|
||||||
plugAssets,
|
plugAssets,
|
||||||
new PrefixedKvPrimitives(baseKvPrimitives, ["*"]),
|
new PrefixedKvPrimitives(baseKvPrimitives, ["*"]),
|
||||||
);
|
);
|
||||||
|
console.log(
|
||||||
|
"Now indexing again to make sure any additional space script indexers are run...",
|
||||||
|
);
|
||||||
|
await runPlug(
|
||||||
|
folder,
|
||||||
|
"index.reindexSpace",
|
||||||
|
[true], // noClear
|
||||||
|
plugAssets,
|
||||||
|
new PrefixedKvPrimitives(baseKvPrimitives, ["*"]),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
const httpServer = new HttpServer({
|
const httpServer = new HttpServer({
|
||||||
hostname,
|
hostname,
|
||||||
|
|
|
@ -16,7 +16,7 @@ export async function ensureSpaceIndex(ds: DataStore, system: System<any>) {
|
||||||
if (currentIndexVersion !== desiredIndexVersion && !indexOngoing) {
|
if (currentIndexVersion !== desiredIndexVersion && !indexOngoing) {
|
||||||
console.info("Performing a full space reindex, this could take a while...");
|
console.info("Performing a full space reindex, this could take a while...");
|
||||||
indexOngoing = true;
|
indexOngoing = true;
|
||||||
await system.invokeFunction("index.reindexSpace", []);
|
await system.invokeFunction("index.reindexSpace", [true]); // noClean = true
|
||||||
console.info("Full space index complete.");
|
console.info("Full space index complete.");
|
||||||
await markFullSpaceIndexComplete(ds);
|
await markFullSpaceIndexComplete(ds);
|
||||||
indexOngoing = false;
|
indexOngoing = false;
|
||||||
|
|
Loading…
Reference in New Issue