mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
Cleanup file conversion handling
This commit is contained in:
parent
3616d16701
commit
e02dc6742a
1 changed files with 8 additions and 9 deletions
|
@ -365,35 +365,34 @@ func (s *Site) CreatePages() error {
|
|||
readErrs := <-errs
|
||||
|
||||
results = make(chan HandledResult)
|
||||
pagechan := make(chan *Page)
|
||||
filechan = make(chan *source.File)
|
||||
pageChan := make(chan *Page)
|
||||
fileConvChan := make(chan *source.File)
|
||||
|
||||
wg = &sync.WaitGroup{}
|
||||
|
||||
for i := 0; i < procs*4; i++ {
|
||||
wg.Add(1)
|
||||
go fileConverter(s, filechan, results, wg)
|
||||
go fileConverter(s, fileConvChan, results, wg)
|
||||
}
|
||||
|
||||
wg = &sync.WaitGroup{}
|
||||
for i := 0; i < procs*4; i++ {
|
||||
wg.Add(1)
|
||||
go pageConverter(s, pagechan, results, wg)
|
||||
go pageConverter(s, pageChan, results, wg)
|
||||
}
|
||||
|
||||
go converterCollator(s, results, errs)
|
||||
|
||||
for _, p := range s.Pages {
|
||||
pagechan <- p
|
||||
pageChan <- p
|
||||
}
|
||||
|
||||
for _, f := range s.Files {
|
||||
fmt.Println(f)
|
||||
filechan <- f
|
||||
fileConvChan <- f
|
||||
}
|
||||
|
||||
close(pagechan)
|
||||
close(filechan)
|
||||
close(pageChan)
|
||||
close(fileConvChan)
|
||||
|
||||
wg.Wait()
|
||||
|
||||
|
|
Loading…
Reference in a new issue