File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -286,6 +286,9 @@ module.exports = async function build(
286
286
)
287
287
}
288
288
289
+ // Start saving page.mode in the main process (while queries run in workers in parallel)
290
+ const waitMaterializePageMode = materializePageMode ( )
291
+
289
292
let waitForWorkerPoolRestart = Promise . resolve ( )
290
293
if ( process . env . GATSBY_EXPERIMENTAL_PARALLEL_QUERY_RUNNING ) {
291
294
await runQueriesInWorkersQueue ( workerPool , queryIds , {
@@ -322,6 +325,7 @@ module.exports = async function build(
322
325
}
323
326
324
327
if ( process . send && shouldGenerateEngines ( ) ) {
328
+ await waitMaterializePageMode
325
329
process . send ( {
326
330
type : `LOG_ACTION` ,
327
331
action : {
@@ -401,9 +405,6 @@ module.exports = async function build(
401
405
402
406
await waitForWorkerPoolRestart
403
407
404
- // Start saving page.mode in the main process (while HTML is generated in workers in parallel)
405
- const waitMaterializePageMode = materializePageMode ( )
406
-
407
408
const { toRegenerate, toDelete } =
408
409
await buildHTMLPagesAndDeleteStaleArtifacts ( {
409
410
program,
Original file line number Diff line number Diff line change 8
8
import { reportOnce } from "./report-once"
9
9
import { ROUTES_DIRECTORY } from "../constants"
10
10
import { Runner } from "../bootstrap/create-graphql-runner"
11
+ import { getDataStore } from "../datastore"
11
12
12
13
type IPageConfigFn = ( arg : { params : Record < string , unknown > } ) => {
13
14
defer : boolean
@@ -111,6 +112,7 @@ export async function materializePageMode(): Promise<void> {
111
112
await new Promise ( resolve => setImmediate ( resolve ) )
112
113
}
113
114
}
115
+ await getDataStore ( ) . ready ( )
114
116
}
115
117
116
118
export async function preparePageTemplateConfigs (
You can’t perform that action at this time.
0 commit comments