mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-22 02:47:48 +08:00
Remove unnecessay prefetch
This commit is contained in:
parent
210bb66727
commit
f6b707d85f
@ -14,7 +14,6 @@ import (
|
||||
cmds "github.com/ipfs/go-ipfs-cmds"
|
||||
files "github.com/ipfs/go-ipfs-files"
|
||||
ipld "github.com/ipfs/go-ipld-format"
|
||||
mdag "github.com/ipfs/go-merkledag"
|
||||
ipfspath "github.com/ipfs/go-path"
|
||||
path "github.com/ipfs/interface-go-ipfs-core/path"
|
||||
mh "github.com/multiformats/go-multihash"
|
||||
@ -271,33 +270,22 @@ The output of blocks happens in strict DAG-traversal, first-seen, order.
|
||||
)
|
||||
}
|
||||
|
||||
// The current interface of go-car is rather suboptimal as it
|
||||
// only takes a blockstore, instead of accepting a dagservice,
|
||||
// and leveraging parallel-fetch capabilities
|
||||
// https://github.com/ipld/go-car/issues/27
|
||||
//
|
||||
// Until the above is fixed, pre-warm the blockstore before doing
|
||||
// anything else. We explicitly *DO NOT* take a lock during this
|
||||
// operation: even if we lose some of the blocks we just received
|
||||
// due to a conflicting GC: we will just re-retrieve anything we
|
||||
// potentially lost when the car is being streamed out
|
||||
node, err := cmdenv.GetNode(env)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := mdag.FetchGraph(req.Context, c, node.DAG); err != nil {
|
||||
if !node.IsOnline {
|
||||
err = fmt.Errorf("%s (currently offline, perhaps retry after attaching to the network)", err)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// Code disabled until descent-issue in go-ipld-prime is fixed
|
||||
//
|
||||
// The second part of the above - make a super-thin wrapper around
|
||||
// a blockservice session, translating Session.GetBlock() to Blockstore.Get()
|
||||
//
|
||||
// The current interface of go-car is rather suboptimal as it
|
||||
// only takes a blockstore, instead of accepting a dagservice,
|
||||
// and leveraging parallel-fetch capabilities
|
||||
// https://github.com/ipld/go-car/issues/27
|
||||
//
|
||||
//
|
||||
// sess := blockservice.NewSession(
|
||||
// req.Context,
|
||||
// node.Blocks,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user