mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-14 20:17:17 +00:00
hugolib: Add a temporary workaround for page.copy() data race
See ##3129
This commit is contained in:
1 parent
c7b8c45d12
commit
6c5ef71368
1 file changed
+3
@@ -1655,6 +1655,9 @@ func (p *Page) updatePageDates() {
|
|||||||
// copy creates a copy of this page with the lazy sync.Once vars reset
|
// copy creates a copy of this page with the lazy sync.Once vars reset
|
||||||
// so they will be evaluated again, for word count calculations etc.
|
// so they will be evaluated again, for word count calculations etc.
|
||||||
func (p *Page) copy() *Page {
|
func (p *Page) copy() *Page {
|
||||||
|
// This is a temporary workaround for the data race in #3129
|
||||||
|
p.getPermalink()
|
||||||
|
|
||||||
c := *p
|
c := *p
|
||||||
c.pageInit = &pageInit{}
|
c.pageInit = &pageInit{}
|
||||||
return &c
|
return &c
|
||||||
|
|||||||
Reference in new issue
Block a user