mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-04-20 19:38:39 +00:00
Lock collections before building graph. #169
This commit is contained in:
13
api/graph.go
13
api/graph.go
@@ -17,7 +17,18 @@ func apiGraph(c *gin.Context) {
|
||||
output []byte
|
||||
)
|
||||
|
||||
graph, err := deb.BuildGraph(context.CollectionFactory())
|
||||
factory := context.CollectionFactory()
|
||||
|
||||
factory.RemoteRepoCollection().RLock()
|
||||
defer factory.RemoteRepoCollection().RUnlock()
|
||||
factory.LocalRepoCollection().RLock()
|
||||
defer factory.LocalRepoCollection().RUnlock()
|
||||
factory.SnapshotCollection().RLock()
|
||||
defer factory.LocalRepoCollection().RUnlock()
|
||||
factory.PublishedRepoCollection().RLock()
|
||||
defer factory.PublishedRepoCollection().RUnlock()
|
||||
|
||||
graph, err := deb.BuildGraph(factory)
|
||||
if err != nil {
|
||||
c.JSON(500, err)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user