fix: we need to track when the queue is finished ourselves

This commit is contained in:
Derrick Hammer 2024-03-01 10:11:03 -05:00
parent b272e32185
commit aacdd48428
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 7 additions and 1 deletions

View File

@ -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)
} }