Skip to content

Commit 98f22e7

Browse files
sidharthachatterjeegatsbybot
and
gatsbybot
authored
fix(gatsby): Wait for jobs to complete in onPostBuild (#28534)
Co-authored-by: gatsbybot <[email protected]>
1 parent a93c71d commit 98f22e7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/gatsby/src/commands/build.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,10 @@ module.exports = async function build(program: IBuildArgs): Promise<void> {
296296
})
297297
postBuildActivityTimer.end()
298298

299+
// Wait for any jobs that were started in onPostBuild
300+
// This could occur due to queries being run which invoke sharp for instance
301+
await waitUntilAllJobsComplete()
302+
299303
// Make sure we saved the latest state so we have all jobs cached
300304
await db.saveState()
301305

0 commit comments

Comments
 (0)