mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-10-19 10:47:13 +00:00
Fix race in API related to LoadComplete()
LoadComplete() modifies object, so it would cause issues if it runs concurrently with other methods. Uprage mutex locks to write locks when LoadComplete() is being used.
This commit is contained in:
1 parent
9cb2a302f8
commit
43ddcd27cb
4 files changed
+32
-32
No files matched your search
+2
-2
@@ -162,8 +162,8 @@ func apiReposDrop(c *gin.Context) {
|
||||
// GET /api/repos/:name/packages
|
||||
func apiReposPackagesShow(c *gin.Context) {
|
||||
collection := context.CollectionFactory().LocalRepoCollection()
|
||||
collection.RLock()
|
||||
defer collection.RUnlock()
|
||||
collection.Lock()
|
||||
defer collection.Unlock()
|
||||
|
||||
repo, err := collection.ByName(c.Params.ByName("name"))
|
||||
if err != nil {
|
||||
|
||||
Reference in new issue
Block a user