mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-05 05:20:34 +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:
+8
-8
@@ -24,14 +24,14 @@ func apiGraph(c *gin.Context) {
|
||||
|
||||
factory := context.CollectionFactory()
|
||||
|
||||
factory.RemoteRepoCollection().RLock()
|
||||
defer factory.RemoteRepoCollection().RUnlock()
|
||||
factory.LocalRepoCollection().RLock()
|
||||
defer factory.LocalRepoCollection().RUnlock()
|
||||
factory.SnapshotCollection().RLock()
|
||||
defer factory.SnapshotCollection().RUnlock()
|
||||
factory.PublishedRepoCollection().RLock()
|
||||
defer factory.PublishedRepoCollection().RUnlock()
|
||||
factory.RemoteRepoCollection().Lock()
|
||||
defer factory.RemoteRepoCollection().Unlock()
|
||||
factory.LocalRepoCollection().Lock()
|
||||
defer factory.LocalRepoCollection().Unlock()
|
||||
factory.SnapshotCollection().Lock()
|
||||
defer factory.SnapshotCollection().Unlock()
|
||||
factory.PublishedRepoCollection().Lock()
|
||||
defer factory.PublishedRepoCollection().Unlock()
|
||||
|
||||
graph, err := deb.BuildGraph(factory, layout)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user