diff --git a/cmd/lotus-miner/dagstore.go b/cmd/lotus-miner/dagstore.go index ab0f0cee7..0fd95a411 100644 --- a/cmd/lotus-miner/dagstore.go +++ b/cmd/lotus-miner/dagstore.go @@ -62,7 +62,7 @@ var dagstoreListShardsCmd = &cli.Command{ "Key": s.Key, "State": func() string { if c, ok := colors[s.State]; ok { - return color.New(c).Sprint(s) + return color.New(c).Sprint(s.State) } return s.State }(), @@ -170,9 +170,9 @@ var dagstoreGcCmd = &cli.Command{ for _, e := range collected { if e.Error == "" { - _, _ = fmt.Fprintln(os.Stdout, e.Key, "success") + _, _ = fmt.Fprintln(os.Stdout, e.Key, color.New(color.FgGreen).Sprint("SUCCESS")) } else { - _, _ = fmt.Fprintln(os.Stdout, e.Key, "failed:", e.Error) + _, _ = fmt.Fprintln(os.Stdout, e.Key, color.New(color.FgRed).Sprint("ERROR"), e.Error) } } diff --git a/node/impl/storminer.go b/node/impl/storminer.go index fbfb0cff7..fb06ebfaa 100644 --- a/node/impl/storminer.go +++ b/node/impl/storminer.go @@ -656,7 +656,7 @@ func (sm *StorageMinerAPI) DagstoreInitializeAll(ctx context.Context, params api res := make(chan api.DagstoreShardResult, 32) // returned to caller. go func() { - close(res) // close the caller channel. + defer close(res) // close the caller channel. pending := len(uninit) for pending > 0 {