retrieval: Fix deadlock in ClientGetRetrievalUpdates

This commit is contained in:
Łukasz Magiera 2021-11-23 18:32:56 +01:00
parent 83f65a673b
commit 78949d6c05

View File

@ -1157,7 +1157,10 @@ func (a *API) ClientGetRetrievalUpdates(ctx context.Context) (<-chan api.Retriev
unsub := a.Retrieval.SubscribeToEvents(func(evt rm.ClientEvent, deal rm.ClientDealState) {
update := a.newRetrievalInfo(ctx, deal)
update.Event = &evt
updates <- update
select {
case updates <- update:
case <-ctx.Done():
}
})
go func() {