mirror of
https://github.com/gohugoio/hugo.git
synced 2025-09-02 22:52:51 +02:00
Merge branch 'release-0.55.6'
This commit is contained in:
@@ -62,6 +62,9 @@ type HugoSites struct {
|
||||
// If this is running in the dev server.
|
||||
running bool
|
||||
|
||||
// Serializes rebuilds when server is running.
|
||||
runningMu sync.Mutex
|
||||
|
||||
// Render output formats for all sites.
|
||||
renderFormats output.Formats
|
||||
|
||||
|
@@ -31,6 +31,12 @@ import (
|
||||
// Build builds all sites. If filesystem events are provided,
|
||||
// this is considered to be a potential partial rebuild.
|
||||
func (h *HugoSites) Build(config BuildCfg, events ...fsnotify.Event) error {
|
||||
if h.running {
|
||||
// Make sure we don't trigger rebuilds in parallel.
|
||||
h.runningMu.Lock()
|
||||
defer h.runningMu.Unlock()
|
||||
}
|
||||
|
||||
ctx, task := trace.NewTask(context.Background(), "Build")
|
||||
defer task.End()
|
||||
|
||||
|
Reference in New Issue
Block a user