diff --git a/README.md b/README.md index f19af1a..8dee674 100644 --- a/README.md +++ b/README.md @@ -8,4 +8,4 @@ A Contentful API code generator for Go. Features: - Simplifies management/resolution of references - Adds several utility functions for RichText from/to HTML conversion, assets handling and more -Full documentation available at [foomo.org](https://www.foomo.org/docs/backend/gocontentful/introduction) \ No newline at end of file +Full documentation available at [foomo.org](https://www.foomo.org/docs/projects/cms/gocontentful/introduction) diff --git a/erm/templates/contentful_vo_lib.gotmpl b/erm/templates/contentful_vo_lib.gotmpl index 60a4a37..32b8668 100644 --- a/erm/templates/contentful_vo_lib.gotmpl +++ b/erm/templates/contentful_vo_lib.gotmpl @@ -616,7 +616,7 @@ func (cc *ContentfulClient) UpdateCache(ctx context.Context, contentTypes []stri return cc.syncCache(ctxAtWork, contentTypes) } cc.cacheWorkerOnce.Do(func() { - go cc.cacheWorker(ctxAtWork, contentTypes, cacheAssets) + go cc.cacheWorker(ctx, contentTypes, cacheAssets) }) if len(cc.cacheQueue) == 0 { if cc.logFn != nil && cc.logLevel <= LogInfo { @@ -695,9 +695,9 @@ func (cc *ContentfulClient) syncCache(ctx context.Context, contentTypes []string } updateCacheForContentTypeAndEntity(ctx, cc, entry.Sys.ContentType.Sys.ID, entry.Sys.ID, entry, false) case sysTypeDeletedEntry: - cc.Cache.idContentTypeMapGcLock.RLock() + cc.cacheMutex.idContentTypeMapGcLock.RLock() contentType := cc.Cache.idContentTypeMap[entry.Sys.ID] - cc.Cache.idContentTypeMapGcLock.RUnlock() + cc.cacheMutex.idContentTypeMapGcLock.RUnlock() updateCacheForContentTypeAndEntity(ctx, cc, contentType, entry.Sys.ID, entry, true) default: } diff --git a/main.go b/main.go index da241f4..41e3d4d 100644 --- a/main.go +++ b/main.go @@ -13,7 +13,7 @@ import ( "github.com/foomo/gocontentful/erm" ) -var VERSION = "v1.0.15" +var VERSION = "v1.0.16" type contentfulRc struct { ManagementToken string `json:"managementToken"` diff --git a/test/testapi/gocontentfulvo.go b/test/testapi/gocontentfulvo.go index 3a524c7..765327b 100644 --- a/test/testapi/gocontentfulvo.go +++ b/test/testapi/gocontentfulvo.go @@ -1,4 +1,4 @@ -// Code generated by https://github.com/foomo/gocontentful v1.0.16beta - DO NOT EDIT. +// Code generated by https://github.com/foomo/gocontentful v1.0.16 - DO NOT EDIT. package testapi import ( diff --git a/test/testapi/gocontentfulvobase.go b/test/testapi/gocontentfulvobase.go index b7dab52..8cdc404 100644 --- a/test/testapi/gocontentfulvobase.go +++ b/test/testapi/gocontentfulvobase.go @@ -1,4 +1,4 @@ -// Code generated by https://github.com/foomo/gocontentful v1.0.16beta - DO NOT EDIT. +// Code generated by https://github.com/foomo/gocontentful v1.0.16 - DO NOT EDIT. package testapi import "github.com/foomo/contentful" diff --git a/test/testapi/gocontentfulvolib.go b/test/testapi/gocontentfulvolib.go index b12dd1b..e073a25 100644 --- a/test/testapi/gocontentfulvolib.go +++ b/test/testapi/gocontentfulvolib.go @@ -1,4 +1,4 @@ -// Code generated by https://github.com/foomo/gocontentful v1.0.16beta - DO NOT EDIT. +// Code generated by https://github.com/foomo/gocontentful v1.0.16 - DO NOT EDIT. package testapi import ( @@ -650,7 +650,7 @@ func (cc *ContentfulClient) UpdateCache(ctx context.Context, contentTypes []stri return cc.syncCache(ctxAtWork, contentTypes) } cc.cacheWorkerOnce.Do(func() { - go cc.cacheWorker(ctxAtWork, contentTypes, cacheAssets) + go cc.cacheWorker(ctx, contentTypes, cacheAssets) }) if len(cc.cacheQueue) == 0 { if cc.logFn != nil && cc.logLevel <= LogInfo { @@ -729,7 +729,9 @@ func (cc *ContentfulClient) syncCache(ctx context.Context, contentTypes []string } updateCacheForContentTypeAndEntity(ctx, cc, entry.Sys.ContentType.Sys.ID, entry.Sys.ID, entry, false) case sysTypeDeletedEntry: + cc.cacheMutex.idContentTypeMapGcLock.RLock() contentType := cc.Cache.idContentTypeMap[entry.Sys.ID] + cc.cacheMutex.idContentTypeMapGcLock.RUnlock() updateCacheForContentTypeAndEntity(ctx, cc, contentType, entry.Sys.ID, entry, true) default: } diff --git a/test/testapi/gocontentfulvolibbrand.go b/test/testapi/gocontentfulvolibbrand.go index 0f42cee..f6025ef 100644 --- a/test/testapi/gocontentfulvolibbrand.go +++ b/test/testapi/gocontentfulvolibbrand.go @@ -1,4 +1,4 @@ -// Code generated by https://github.com/foomo/gocontentful v1.0.16beta - DO NOT EDIT. +// Code generated by https://github.com/foomo/gocontentful v1.0.16 - DO NOT EDIT. package testapi import ( diff --git a/test/testapi/gocontentfulvolibcategory.go b/test/testapi/gocontentfulvolibcategory.go index ea61c50..a376770 100644 --- a/test/testapi/gocontentfulvolibcategory.go +++ b/test/testapi/gocontentfulvolibcategory.go @@ -1,4 +1,4 @@ -// Code generated by https://github.com/foomo/gocontentful v1.0.16beta - DO NOT EDIT. +// Code generated by https://github.com/foomo/gocontentful v1.0.16 - DO NOT EDIT. package testapi import ( diff --git a/test/testapi/gocontentfulvolibproduct.go b/test/testapi/gocontentfulvolibproduct.go index d14be75..705e7c6 100644 --- a/test/testapi/gocontentfulvolibproduct.go +++ b/test/testapi/gocontentfulvolibproduct.go @@ -1,4 +1,4 @@ -// Code generated by https://github.com/foomo/gocontentful v1.0.16beta - DO NOT EDIT. +// Code generated by https://github.com/foomo/gocontentful v1.0.16 - DO NOT EDIT. package testapi import (