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
|
readErrs := <-errs
|
||||||
|
|
||||||
results = make(chan HandledResult)
|
results = make(chan HandledResult)
|
||||||
pagechan := make(chan *Page)
|
pageChan := make(chan *Page)
|
||||||
filechan = make(chan *source.File)
|
fileConvChan := make(chan *source.File)
|
||||||
|
|
||||||
wg = &sync.WaitGroup{}
|
wg = &sync.WaitGroup{}
|
||||||
|
|
||||||
for i := 0; i < procs*4; i++ {
|
for i := 0; i < procs*4; i++ {
|
||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
go fileConverter(s, filechan, results, wg)
|
go fileConverter(s, fileConvChan, results, wg)
|
||||||
}
|
}
|
||||||
|
|
||||||
wg = &sync.WaitGroup{}
|
wg = &sync.WaitGroup{}
|
||||||
for i := 0; i < procs*4; i++ {
|
for i := 0; i < procs*4; i++ {
|
||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
go pageConverter(s, pagechan, results, wg)
|
go pageConverter(s, pageChan, results, wg)
|
||||||
}
|
}
|
||||||
|
|
||||||
go converterCollator(s, results, errs)
|
go converterCollator(s, results, errs)
|
||||||
|
|
||||||
for _, p := range s.Pages {
|
for _, p := range s.Pages {
|
||||||
pagechan <- p
|
pageChan <- p
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, f := range s.Files {
|
for _, f := range s.Files {
|
||||||
fmt.Println(f)
|
fileConvChan <- f
|
||||||
filechan <- f
|
|
||||||
}
|
}
|
||||||
|
|
||||||
close(pagechan)
|
close(pageChan)
|
||||||
close(filechan)
|
close(fileConvChan)
|
||||||
|
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue