mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-15 20:44:01 +02:00
Fix leaky goroutine
By making the err chan buffered so both go routines can return. Also make sure that any errors are logged. Fixes #2488
This commit is contained in:
committed by
GitHub
parent
63a6da06d8
commit
a0167d838e
@@ -526,7 +526,7 @@ func (s *Site) reBuild(events []fsnotify.Event) (whatChanged, error) {
|
||||
// We do this in parallel... even though it's likely only one file at a time.
|
||||
// We need to process the reading prior to the conversion for each file, but
|
||||
// we can convert one file while another one is still reading.
|
||||
errs := make(chan error)
|
||||
errs := make(chan error, 2)
|
||||
readResults := make(chan HandledResult)
|
||||
filechan := make(chan *source.File)
|
||||
convertResults := make(chan HandledResult)
|
||||
@@ -611,6 +611,13 @@ func (s *Site) reBuild(events []fsnotify.Event) (whatChanged, error) {
|
||||
|
||||
s.timerStep("read & convert pages from source")
|
||||
|
||||
for i := 0; i < 2; i++ {
|
||||
err := <-errs
|
||||
if err != nil {
|
||||
jww.ERROR.Println(err)
|
||||
}
|
||||
}
|
||||
|
||||
changed := whatChanged{
|
||||
source: len(sourceChanged) > 0,
|
||||
other: len(tmplChanged) > 0 || len(i18nChanged) > 0 || len(dataChanged) > 0,
|
||||
|
Reference in New Issue
Block a user