Skip to content

Commit

Permalink
Merge pull request #5687 from chenminjian/fix/cmd/gc
Browse files Browse the repository at this point in the history
fix(cmd/gc): Run func does not return error when Emit func returns error
  • Loading branch information
Stebalien authored Oct 29, 2018
2 parents 46ee56f + 78d878e commit 8008246
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions core/commands/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,14 @@ order to reclaim hard disk space.
errs := false
for res := range gcOutChan {
if res.Error != nil {
re.Emit(&GcResult{Error: res.Error.Error()})
if err := re.Emit(&GcResult{Error: res.Error.Error()}); err != nil {
return err
}
errs = true
} else {
re.Emit(&GcResult{Key: res.KeyRemoved})
if err := re.Emit(&GcResult{Key: res.KeyRemoved}); err != nil {
return err
}
}
}
if errs {
Expand Down

0 comments on commit 8008246

Please sign in to comment.