From aacdd4842810ad59451ae764e63f2383de8762c5 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Fri, 1 Mar 2024 10:11:03 -0500 Subject: [PATCH] fix: we need to track when the queue is finished ourselves --- api/s5/s5.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/api/s5/s5.go b/api/s5/s5.go index 67ba213..4c00bba 100644 --- a/api/s5/s5.go +++ b/api/s5/s5.go @@ -910,6 +910,7 @@ func (s *S5API) accountPinManifest(jc jape.Context, userId uint, cid *encoding.C } go func() { + received := 0 for ret := range rets { b64, err := ret.cid.ToBase64Url() if err != nil { @@ -921,11 +922,16 @@ func (s *S5API) accountPinManifest(jc jape.Context, userId uint, cid *encoding.C success: ret.success, error: ret.error, } + + received++ + + if received == len(cids) { + q.Release() + } } }() q.Wait() - jc.Encode(&results) }