Skip to content

Commit

Permalink
Print path
Browse files Browse the repository at this point in the history
  • Loading branch information
gagliardetto committed Dec 11, 2024
1 parent 7783ec4 commit a0fbc9a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions cmd-x-index-all.go
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,8 @@ func createAllIndexes(
wg.Go(func() error {
klog.Infof("Sealing slot_to_blocktime index...")

file, err := os.Create(filepath.Join(indexDir, blocktimeindex.FormatFilename(epoch, rootCID, network)))
path := filepath.Join(indexDir, blocktimeindex.FormatFilename(epoch, rootCID, network))
file, err := os.Create(path)
if err != nil {
return fmt.Errorf("failed to create slot_to_blocktime index file: %w", err)
}
Expand All @@ -416,7 +417,8 @@ func createAllIndexes(
if _, err := slot_to_blocktime.WriteTo(file); err != nil {
return fmt.Errorf("failed to write slot_to_blocktime index: %w", err)
}
klog.Infof("Successfully sealed slot_to_blocktime index")
paths.SlotToBlocktime = path
klog.Infof("Successfully sealed slot_to_blocktime index: %s", paths.SlotToBlocktime)
return nil
})

Expand All @@ -441,6 +443,7 @@ type IndexPaths struct {
SlotToCid string
SignatureToCid string
SignatureExists string
SlotToBlocktime string
}

// IndexPaths.String
Expand All @@ -458,6 +461,9 @@ func (p *IndexPaths) String() string {
builder.WriteString(" sig_exists:\n uri: ")
builder.WriteString(quoteSingle(p.SignatureExists))
builder.WriteString("\n")
builder.WriteString(" slot_to_blocktime:\n uri: ")
builder.WriteString(quoteSingle(p.SlotToBlocktime))
builder.WriteString("\n")
return builder.String()
}

Expand Down

0 comments on commit a0fbc9a

Please sign in to comment.