every go routine needs to have its own collection factory

this is needed so concurrent reads and writes are possible.
This commit is contained in:
Oliver Sauder authored and Lorenzo Bolla committed 2022-01-27 09:30:14 +01:00
1 parent 4a6d53e16d
commit 208a2151c1
48 files changed
+305 -387

No files matched your search

+2 -1
View File
@@ -6,7 +6,8 @@ import (
// GET /api/packages/:key
func apiPackagesShow(c *gin.Context) {
p, err := context.CollectionFactory().PackageCollection().ByKey([]byte(c.Params.ByName("key")))
collectionFactory := context.NewCollectionFactory()
p, err := collectionFactory.PackageCollection().ByKey([]byte(c.Params.ByName("key")))
if err != nil {
c.AbortWithError(404, err)
return