feat: add logs to wrapper load shard

This commit is contained in:
Dirk McCormick 2021-07-21 17:17:29 +02:00
parent 86e1c854fa
commit 39c1594505

View File

@ -147,6 +147,7 @@ func (ds *Wrapper) background() {
}
func (ds *Wrapper) LoadShard(ctx context.Context, pieceCid cid.Cid) (carstore.ClosableBlockstore, error) {
log.Debugf("acquiring shard for piece CID %s", pieceCid)
key := shard.KeyFromCID(pieceCid)
resch := make(chan dagstore.ShardResult, 1)
err := ds.dagStore.AcquireShard(ctx, key, resch, dagstore.AcquireOpts{})
@ -193,6 +194,7 @@ func (ds *Wrapper) LoadShard(ctx context.Context, pieceCid cid.Cid) (carstore.Cl
return nil, err
}
log.Debugf("successfully loaded blockstore for piece CID %s", pieceCid)
return &closableBlockstore{Blockstore: NewReadOnlyBlockstore(bs), Closer: res.Accessor}, nil
}