mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-01 14:28:02 +08:00
fix(cmd/gc): Run func does not return error when Emit func returns error
License: MIT Signed-off-by: chenminjian <727180553@qq.com>
This commit is contained in:
parent
46ee56f5fc
commit
78d878e253
@ -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 {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user