fix: add comment about car path

This commit is contained in:
Dirk McCormick 2021-07-20 12:52:45 +02:00
parent 1e7095995b
commit 16be5b5478

View File

@ -146,7 +146,12 @@ func (ds *Wrapper) LoadShard(ctx context.Context, pieceCid cid.Cid) (carstore.Cl
// if the DAGStore does not know about the Shard -> register it and then try to acquire it again. // if the DAGStore does not know about the Shard -> register it and then try to acquire it again.
log.Warnw("failed to load shard as shard is not registered, will re-register", "pieceCID", pieceCid) log.Warnw("failed to load shard as shard is not registered, will re-register", "pieceCID", pieceCid)
if err := shared.RegisterShardSync(ctx, ds, pieceCid, "", false); err != nil { // The path of a transient file that we can ask the DAG Store to use
// to perform the Indexing rather than fetching it via the Mount if
// we already have a transient file. However, we don't have it here
// and therefore we pass an empty file path.
carPath := ""
if err := shared.RegisterShardSync(ctx, ds, pieceCid, carPath, false); err != nil {
return nil, xerrors.Errorf("failed to re-register shard during loading piece CID %s: %w", pieceCid, err) return nil, xerrors.Errorf("failed to re-register shard during loading piece CID %s: %w", pieceCid, err)
} }
log.Warnw("successfully re-registered shard", "pieceCID", pieceCid) log.Warnw("successfully re-registered shard", "pieceCID", pieceCid)