lib/model: Progress emitter network operations dont need to be blocking (#6589)

* lib/model: Progress emitter network operations dont need to be blocking

* Do sends outside of the lock
This commit is contained in:
Audrius Butkevicius
2020-05-01 08:54:15 +01:00
committed by GitHub
parent 782bd08aad
commit f86deedd9c
2 changed files with 38 additions and 7 deletions
+6 -2
View File
@@ -461,6 +461,10 @@ func TestSendDownloadProgressMessages(t *testing.T) {
func sendMsgs(p *ProgressEmitter) {
p.mut.Lock()
defer p.mut.Unlock()
p.sendDownloadProgressMessagesLocked(context.Background())
updates := p.computeProgressUpdates()
p.mut.Unlock()
ctx := context.Background()
for _, update := range updates {
update.send(ctx)
}
}