diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-03-24 09:19:49 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-03-24 10:06:58 +0100 |
commit | 93e24a03ce98d3212a2d49ad04739141229d0809 (patch) | |
tree | f906ca508aed65af8e4bbf6141dff8f57499b4d6 /hugolib/site.go | |
parent | e9c7b6205f94a7edac0e0df2cd18d1456cb26a06 (diff) |
hugolib: Fix freeze in invalid front matter error case
Fixes #4526
Diffstat (limited to 'hugolib/site.go')
-rw-r--r-- | hugolib/site.go | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/hugolib/site.go b/hugolib/site.go index 0ffe153e9..c3e2d9cb0 100644 --- a/hugolib/site.go +++ b/hugolib/site.go @@ -1281,19 +1281,19 @@ func (c *contentCaptureResultHandler) getContentProcessor(lang string) *siteCont func (c *contentCaptureResultHandler) handleSingles(fis ...*fileInfo) { for _, fi := range fis { proc := c.getContentProcessor(fi.Lang()) - proc.fileSinglesChan <- fi + proc.processSingle(fi) } } func (c *contentCaptureResultHandler) handleBundles(d *bundleDirs) { for _, b := range d.bundles { proc := c.getContentProcessor(b.fi.Lang()) - proc.fileBundlesChan <- b + proc.processBundle(b) } } func (c *contentCaptureResultHandler) handleCopyFiles(filenames ...string) { for _, proc := range c.contentProcessors { - proc.fileAssetsChan <- filenames + proc.processAssets(filenames) } } @@ -1309,7 +1309,7 @@ func (s *Site) readAndProcessContent(filenames ...string) error { var defaultContentProcessor *siteContentProcessor sites := s.owner.langSite() for k, v := range sites { - proc := newSiteContentProcessor(baseDir, len(filenames) > 0, v) + proc := newSiteContentProcessor(ctx, baseDir, len(filenames) > 0, v) contentProcessors[k] = proc if k == defaultContentLanguage { defaultContentProcessor = proc @@ -1337,15 +1337,18 @@ func (s *Site) readAndProcessContent(filenames ...string) error { c := newCapturer(s.Log, sourceSpec, handler, bundleMap, baseDir, filenames...) - if err := c.capture(); err != nil { - return err - } + err1 := c.capture() for _, proc := range contentProcessors { proc.closeInput() } - return g.Wait() + err2 := g.Wait() + + if err1 != nil { + return err1 + } + return err2 } func (s *Site) buildSiteMeta() (err error) { |