From 7ac1d749dae3c922eaf8eee4a9dd4a085f5dbe3d Mon Sep 17 00:00:00 2001 From: gammazero <11790789+gammazero@users.noreply.github.com> Date: Fri, 6 Dec 2024 11:30:30 -1000 Subject: [PATCH] update to latest boxo --- go.mod | 2 +- go.sum | 4 ++-- setup_bitswap.go | 5 ++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 480bb64..4040e8b 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/felixge/httpsnoop v1.0.4 github.com/ipfs-shipyard/nopfs v0.0.12 github.com/ipfs-shipyard/nopfs/ipfs v0.13.2-0.20231024163508-120e0c51ee3a - github.com/ipfs/boxo v0.24.4-0.20241205031338-f6befafdbb77 + github.com/ipfs/boxo v0.24.4-0.20241206204508-97092042b278 github.com/ipfs/go-block-format v0.2.0 github.com/ipfs/go-cid v0.4.1 github.com/ipfs/go-datastore v0.6.0 diff --git a/go.sum b/go.sum index a35744e..4f20d10 100644 --- a/go.sum +++ b/go.sum @@ -260,8 +260,8 @@ github.com/ipfs-shipyard/nopfs/ipfs v0.13.2-0.20231024163508-120e0c51ee3a h1:MKG github.com/ipfs-shipyard/nopfs/ipfs v0.13.2-0.20231024163508-120e0c51ee3a/go.mod h1:6EekK/jo+TynwSE/ZOiOJd4eEvRXoavEC3vquKtv4yI= github.com/ipfs/bbloom v0.0.4 h1:Gi+8EGJ2y5qiD5FbsbpX/TMNcJw8gSqr7eyjHa4Fhvs= github.com/ipfs/bbloom v0.0.4/go.mod h1:cS9YprKXpoZ9lT0n/Mw/a6/aFV6DTjTLYHeA+gyqMG0= -github.com/ipfs/boxo v0.24.4-0.20241205031338-f6befafdbb77 h1:x+sd6fb4yTDdxYgiNKU7cAS8hIYaznt1US2iIEMgL+A= -github.com/ipfs/boxo v0.24.4-0.20241205031338-f6befafdbb77/go.mod h1:MQVkL3V8RfuIsn+aajCR0MXLl8nRlz+5uGlHMWFVyuE= +github.com/ipfs/boxo v0.24.4-0.20241206204508-97092042b278 h1:fKCxMuR9Sibyea/mI/B9GUclq/vC+4YzA5NSVtUW5co= +github.com/ipfs/boxo v0.24.4-0.20241206204508-97092042b278/go.mod h1:MQVkL3V8RfuIsn+aajCR0MXLl8nRlz+5uGlHMWFVyuE= github.com/ipfs/go-bitfield v1.1.0 h1:fh7FIo8bSwaJEh6DdTWbCeZ1eqOaOkKFI74SCnsWbGA= github.com/ipfs/go-bitfield v1.1.0/go.mod h1:paqf1wjq/D2BBmzfTVFlJQ9IlFOZpg422HL0HqsGWHU= github.com/ipfs/go-bitswap v0.11.0 h1:j1WVvhDX1yhG32NTC9xfxnqycqYIlhzEzLXG/cU1HyQ= diff --git a/setup_bitswap.go b/setup_bitswap.go index 75582f2..59b953a 100644 --- a/setup_bitswap.go +++ b/setup_bitswap.go @@ -28,7 +28,7 @@ func setupBitswapExchange(ctx context.Context, cfg Config, h host.Host, cr routi // Custom query manager with the content router and the host // and our custom options to overwrite the default. - pqm, err := providerquerymanager.New(ctx, h, cr, + pqm, err := providerquerymanager.New(h, cr, providerquerymanager.WithMaxInProcessRequests(cfg.RoutingMaxRequests), providerquerymanager.WithMaxProviders(cfg.RoutingMaxProviders), providerquerymanager.WithMaxTimeout(cfg.RoutingMaxTimeout), @@ -36,6 +36,9 @@ func setupBitswapExchange(ctx context.Context, cfg Config, h host.Host, cr routi if err != nil { panic(err) } + context.AfterFunc(ctx, func() { + pqm.Close() + }) // --- Client Options // bitswap.RebroadcastDelay: default is 1 minute to search for a random