fix: we need to track when the queue is finished ourselves
This commit is contained in:
parent
b272e32185
commit
aacdd48428
|
@ -910,6 +910,7 @@ func (s *S5API) accountPinManifest(jc jape.Context, userId uint, cid *encoding.C
|
||||||
}
|
}
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
|
received := 0
|
||||||
for ret := range rets {
|
for ret := range rets {
|
||||||
b64, err := ret.cid.ToBase64Url()
|
b64, err := ret.cid.ToBase64Url()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -921,11 +922,16 @@ func (s *S5API) accountPinManifest(jc jape.Context, userId uint, cid *encoding.C
|
||||||
success: ret.success,
|
success: ret.success,
|
||||||
error: ret.error,
|
error: ret.error,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
received++
|
||||||
|
|
||||||
|
if received == len(cids) {
|
||||||
|
q.Release()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
q.Wait()
|
q.Wait()
|
||||||
|
|
||||||
jc.Encode(&results)
|
jc.Encode(&results)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue