Skip to content

Commit

Permalink
metadata fix
Browse files Browse the repository at this point in the history
  • Loading branch information
anjor committed Sep 17, 2024
1 parent f34b8aa commit 1a9a164
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cmd-car-split.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func newCmd_SplitCar() *cli.Command {

carFiles = append(carFiles, carFile{name: fmt.Sprintf("epoch-%d-%d.car", epoch, currentFileNum), commP: commCid, payloadCid: sl.(cidlink.Link).Cid, paddedSize: ps, fileSize: currentFileSize})

metadata.CarPieces.CarPieces = append(metadata.CarPieces.CarPieces, carlet.CarFile{Name: currentSubsetInfo.fileName, ContentSize: currentFileSize, HeaderSize: uint64(len(nulRootCarHeader))})
metadata.CarPieces.CarPieces = append(metadata.CarPieces.CarPieces, carlet.CarFile{Name: currentSubsetInfo.fileName, ContentSize: currentFileSize, HeaderSize: uint64(len(nulRootCarHeader)), CommP: commCid})

err = closeFile(bufferedWriter, currentFile)
if err != nil {
Expand Down Expand Up @@ -292,8 +292,6 @@ func newCmd_SplitCar() *cli.Command {
}
subsetLinks = append(subsetLinks, sl)

metadata.CarPieces.CarPieces = append(metadata.CarPieces.CarPieces, carlet.CarFile{Name: currentSubsetInfo.fileName, ContentSize: currentFileSize, HeaderSize: uint64(len(nulRootCarHeader))})

epochNode, err := qp.BuildMap(ipldbindcode.Prototypes.Epoch, -1, func(ma datamodel.MapAssembler) {
qp.MapEntry(ma, "kind", qp.Int(int64(iplddecoders.KindEpoch)))
qp.MapEntry(ma, "epoch", qp.Int(int64(epoch)))
Expand Down Expand Up @@ -325,6 +323,7 @@ func newCmd_SplitCar() *cli.Command {
}

carFiles = append(carFiles, carFile{name: fmt.Sprintf("epoch-%d-%d.car", epoch, currentFileNum), commP: commCid, payloadCid: sl.(cidlink.Link).Cid, paddedSize: ps, fileSize: currentFileSize})
metadata.CarPieces.CarPieces = append(metadata.CarPieces.CarPieces, carlet.CarFile{Name: currentSubsetInfo.fileName, ContentSize: currentFileSize, HeaderSize: uint64(len(nulRootCarHeader)), CommP: commCid})

f, err := os.Create(meta)
defer f.Close()
Expand Down

0 comments on commit 1a9a164

Please sign in to comment.