feat: output more info in pending-publish CLI
This commit is contained in:
parent
af45b299e7
commit
614844dc94
@ -858,18 +858,25 @@ var dealsPendingPublish = &cli.Command{
|
|||||||
return xerrors.Errorf("getting pending deals: %w", err)
|
return xerrors.Errorf("getting pending deals: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
w := tabwriter.NewWriter(os.Stdout, 2, 4, 2, ' ', 0)
|
if len(pending.Deals) > 0 {
|
||||||
_, _ = fmt.Fprintf(w, "ProposalCID\tClient\tSize\n")
|
w := tabwriter.NewWriter(os.Stdout, 2, 4, 2, ' ', 0)
|
||||||
|
_, _ = fmt.Fprintf(w, "Publish period: %s\n", pending.PublishPeriod)
|
||||||
|
_, _ = fmt.Fprintf(w, "First deal queued at: %s\n", pending.PublishPeriodStart)
|
||||||
|
_, _ = fmt.Fprintf(w, "Deals will be published at: %s\n", pending.PublishPeriodStart.Add(pending.PublishPeriod))
|
||||||
|
_, _ = fmt.Fprintf(w, "%d deals queued to be published:\n", len(pending.Deals))
|
||||||
|
_, _ = fmt.Fprintf(w, "ProposalCID\tClient\tSize\n")
|
||||||
|
for _, deal := range pending.Deals {
|
||||||
|
proposalNd, err := cborutil.AsIpld(&deal) // nolint
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
for _, deal := range pending.Deals {
|
_, _ = fmt.Fprintf(w, "%s\t%s\t%s\n", proposalNd.Cid(), deal.Proposal.Client, units.BytesSize(float64(deal.Proposal.PieceSize)))
|
||||||
proposalNd, err := cborutil.AsIpld(&deal) // nolint
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
|
return w.Flush()
|
||||||
_, _ = fmt.Fprintf(w, "%s\t%s\t%s\n", proposalNd.Cid(), deal.Proposal.Client, units.BytesSize(float64(deal.Proposal.PieceSize)))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return w.Flush()
|
fmt.Println("No deals queued to be published")
|
||||||
|
return nil
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user