mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-14 06:17:45 +00:00
fixing race condition in CreatePages
This commit is contained in:
1 parent
c5ae2a2d1d
commit
0282c922b4
1 file changed
+2
-7
+2
-7
@@ -343,8 +343,8 @@ func (s *Site) CreatePages() error {
|
|||||||
|
|
||||||
wg := &sync.WaitGroup{}
|
wg := &sync.WaitGroup{}
|
||||||
|
|
||||||
|
wg.Add(procs * 4)
|
||||||
for i := 0; i < procs*4; i++ {
|
for i := 0; i < procs*4; i++ {
|
||||||
wg.Add(1)
|
|
||||||
go sourceReader(s, filechan, results, wg)
|
go sourceReader(s, filechan, results, wg)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -372,14 +372,9 @@ func (s *Site) CreatePages() error {
|
|||||||
|
|
||||||
wg = &sync.WaitGroup{}
|
wg = &sync.WaitGroup{}
|
||||||
|
|
||||||
|
wg.Add(2 * procs * 4)
|
||||||
for i := 0; i < procs*4; i++ {
|
for i := 0; i < procs*4; i++ {
|
||||||
wg.Add(1)
|
|
||||||
go fileConverter(s, fileConvChan, 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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user