Skip to content

Commit

Permalink
fix(gatsby-plugin-sharp): run sharp in 1 core when in gatsby worker (#…
Browse files Browse the repository at this point in the history
…33505)

Co-authored-by: Lennart <lekoarts@gmail.com>
  • Loading branch information
wardpeet and LekoArts committed Oct 13, 2021
1 parent 7fd98e3 commit 4658b80
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/gatsby-plugin-sharp/src/gatsby-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ const q = queue(
args.pluginOptions
)
),
Math.max(1, cpuCoreCount() - 1)
// When inside query workers, we only want to use the current core
process.env.GATSBY_WORKER_POOL_WORKER ? 1 : Math.max(1, cpuCoreCount() - 1)
)

/**
Expand Down

0 comments on commit 4658b80

Please sign in to comment.