Skip to content

Commit 7a02232

Browse files
author
Daniel Thomas
committed
fix: add missing RLock on commonGetParents function
1 parent 76574b2 commit 7a02232

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

erm/templates/contentful_vo_lib.gotmpl

+2
Original file line numberDiff line numberDiff line change
@@ -1484,6 +1484,8 @@ func updateCacheForContentTypeAndEntity(ctx context.Context, cc *ContentfulClien
14841484
func commonGetParents(cc *ContentfulClient, id string, contentType []string) (parents []EntryReference, err error) {
14851485
parents = []EntryReference{}
14861486
if cc.cacheInit {
1487+
cc.cacheMutex.parentMapGcLock.RLock()
1488+
defer cc.cacheMutex.parentMapGcLock.RUnlock()
14871489
if len(contentType) != 0 {
14881490
for _, parent := range cc.Cache.parentMap[id] {
14891491
if parent.ContentType == contentType[0] {

test/testapi/gocontentfulvolib.go

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)