diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-04-05 10:09:22 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-04-05 10:21:25 +0200 |
commit | 87b16abd93ff60acd245776d5b0d914fd580c259 (patch) | |
tree | 19dcc2ef755814cf2b19be533df0fe978db46f55 /hugolib/pagebundler_capture.go | |
parent | 415ca9673d3bd3c06ab94f3d83897c892fce5f27 (diff) |
Add HUGO_NUMWORKERMULTIPLIER
And use that to calculate number of workers, if set, else fall back to number of logical CPUs.
Also tweak the relevant related settings to match the new setup.
Also remove the setting of `runtime.GOMAXPROCS` as this has been the default behaviour since Go 1.5.
Fixes #5814
Diffstat (limited to 'hugolib/pagebundler_capture.go')
-rw-r--r-- | hugolib/pagebundler_capture.go | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/hugolib/pagebundler_capture.go b/hugolib/pagebundler_capture.go index 17a4b865a..7c01a751d 100644 --- a/hugolib/pagebundler_capture.go +++ b/hugolib/pagebundler_capture.go @@ -19,7 +19,8 @@ import ( "os" "path" "path/filepath" - "runtime" + + "github.com/gohugoio/hugo/config" "github.com/gohugoio/hugo/common/loggers" _errors "github.com/pkg/errors" @@ -70,10 +71,7 @@ func newCapturer( contentChanges *contentChangeMap, filenames ...string) *capturer { - numWorkers := 4 - if n := runtime.NumCPU(); n > numWorkers { - numWorkers = n - } + numWorkers := config.GetNumWorkerMultiplier() // TODO(bep) the "index" vs "_index" check/strings should be moved in one place. isBundleHeader := func(filename string) bool { |