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