diff --git a/CHANGELOG.md b/CHANGELOG.md index fa0b9de5b..7557fe40f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -72,6 +72,7 @@ The following emojis are used to highlight certain changes: - `routing/http/client`: creating delegated routing client with `New` now defaults to querying delegated routing server with `DefaultProtocolFilter` ([IPIP-484](https://github.com/ipfs/specs/pull/484)) [#689](https://github.com/ipfs/boxo/pull/689) - `bitswap/client`: Wait at lease one broadcast interval before resending wants to a peer. Check for peers to rebroadcast to more often than one broadcast interval. - No longer using `github.com/jbenet/goprocess` to avoid requiring in dependents. [#710](https://github.com/ipfs/boxo/pull/710) +- Refactor remote pinning `Ls` to take results channel instead of returning one. The previous `Ls` behavior is implemented by the GoLs function, which creates the channels, starts the goroutine that calls Ls, and returns the channels to the caller ### Removed diff --git a/pinning/remote/client/client.go b/pinning/remote/client/client.go index 28f37bbce..3b6270093 100644 --- a/pinning/remote/client/client.go +++ b/pinning/remote/client/client.go @@ -193,7 +193,7 @@ func (c *Client) Ls(ctx context.Context, res chan<- PinStatusGetter, opts ...LsO batchSize := len(results) if int(pinRes.Count) == batchSize { // no more batches - break + return nil } // Better DX/UX for cases like https://github.com/application-research/estuary/issues/124 @@ -204,8 +204,6 @@ func (c *Client) Ls(ctx context.Context, res chan<- PinStatusGetter, opts ...LsO oldestResult := results[batchSize-1] settings.before = &oldestResult.Created } - - return nil } // GoLs creates the results and error channels, starts the goroutine that calls