feat: add ends-in to pending publish deals output

This commit is contained in:
Dirk McCormick 2021-02-08 18:06:50 +01:00
parent 614844dc94
commit eb03422c93

View File

@ -859,8 +859,9 @@ var dealsPendingPublish = &cli.Command{
}
if len(pending.Deals) > 0 {
endsIn := pending.PublishPeriodStart.Add(pending.PublishPeriod).Sub(time.Now())
w := tabwriter.NewWriter(os.Stdout, 2, 4, 2, ' ', 0)
_, _ = fmt.Fprintf(w, "Publish period: %s\n", pending.PublishPeriod)
_, _ = fmt.Fprintf(w, "Publish period: %s (ends in %s)\n", pending.PublishPeriod, endsIn.Round(time.Second))
_, _ = 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))