Skip to content

Commit

Permalink
Add --check flag that allows to run the checks without creating the C…
Browse files Browse the repository at this point in the history
…AR file
  • Loading branch information
gagliardetto committed Aug 9, 2023
1 parent c1e1822 commit 4db65cd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmd/radiance/car/createcar/cmd-create-car.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ var (
flagSkipHash = flags.Bool("skip-hash", false, "Skip hashing the final CAR file after the generation is complete (for debugging)")
flagShredRevision = flags.Int("shred-revision", 2, "Shred revision to use (2 = latest)")
flagNextShredRevisionActivationSlot = flags.Uint64("next-shred-revision-activation-slot", 0, "Next shred revision activation slot")
flagCheckOnly = flags.Bool("check", false, "Only check if the data is available, without creating the CAR file")
)

func init() {
Expand Down Expand Up @@ -218,6 +219,12 @@ func run(c *cobra.Command, args []string) {
)
}

if *flagCheckOnly {
klog.Infof("Check only; exiting")
time.Sleep(1 * time.Second)
os.Exit(0)
}

// write slots to a file {epoch}.slots.txt
slotsFilepath := filepath.Join(filepath.Dir(finalCARFilepath), fmt.Sprintf("%d.slots.txt", epoch))
klog.Infof("Saving slot list to file: %s", slotsFilepath)
Expand Down

0 comments on commit 4db65cd

Please sign in to comment.