fix bugs from testing.
This commit is contained in:
parent
f19f5269df
commit
21d078e7e1
@ -62,7 +62,7 @@ var dagstoreListShardsCmd = &cli.Command{
|
|||||||
"Key": s.Key,
|
"Key": s.Key,
|
||||||
"State": func() string {
|
"State": func() string {
|
||||||
if c, ok := colors[s.State]; ok {
|
if c, ok := colors[s.State]; ok {
|
||||||
return color.New(c).Sprint(s)
|
return color.New(c).Sprint(s.State)
|
||||||
}
|
}
|
||||||
return s.State
|
return s.State
|
||||||
}(),
|
}(),
|
||||||
@ -170,9 +170,9 @@ var dagstoreGcCmd = &cli.Command{
|
|||||||
|
|
||||||
for _, e := range collected {
|
for _, e := range collected {
|
||||||
if e.Error == "" {
|
if e.Error == "" {
|
||||||
_, _ = fmt.Fprintln(os.Stdout, e.Key, "success")
|
_, _ = fmt.Fprintln(os.Stdout, e.Key, color.New(color.FgGreen).Sprint("SUCCESS"))
|
||||||
} else {
|
} else {
|
||||||
_, _ = fmt.Fprintln(os.Stdout, e.Key, "failed:", e.Error)
|
_, _ = fmt.Fprintln(os.Stdout, e.Key, color.New(color.FgRed).Sprint("ERROR"), e.Error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -656,7 +656,7 @@ func (sm *StorageMinerAPI) DagstoreInitializeAll(ctx context.Context, params api
|
|||||||
res := make(chan api.DagstoreShardResult, 32) // returned to caller.
|
res := make(chan api.DagstoreShardResult, 32) // returned to caller.
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
close(res) // close the caller channel.
|
defer close(res) // close the caller channel.
|
||||||
|
|
||||||
pending := len(uninit)
|
pending := len(uninit)
|
||||||
for pending > 0 {
|
for pending > 0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user