mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-06 05:30:57 +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:
+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