Merge pull request #307 from vincentbernat/fix/defer-lock

Fix lock handling in cache flusher for API
This commit is contained in:
Andrey Smirnov
2015-12-03 12:12:35 +03:00
+2
View File
@@ -32,6 +32,7 @@ func cacheFlusher() {
for { for {
<-ticker <-ticker
func() {
// lock everything to eliminate in-progress calls // lock everything to eliminate in-progress calls
r := context.CollectionFactory().RemoteRepoCollection() r := context.CollectionFactory().RemoteRepoCollection()
r.Lock() r.Lock()
@@ -51,6 +52,7 @@ func cacheFlusher() {
// all collections locked, flush them // all collections locked, flush them
context.CollectionFactory().Flush() context.CollectionFactory().Flush()
}()
} }
} }