mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-26 22:04:32 +02:00
hugolib: Add a temporary workaround for page.copy() data race
See ##3129
This commit is contained in:
@@ -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