mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
fileutil: return on error and send it to error chan
This commit is contained in:
parent
e2c2f098bc
commit
dc87454487
@ -57,10 +57,14 @@ func PurgeFile(dirname string, suffix string, max uint, interval time.Duration,
|
||||
err = l.Unlock()
|
||||
if err != nil {
|
||||
plog.Errorf("error unlocking %s when purging file (%v)", l.Name(), err)
|
||||
errC <- err
|
||||
return
|
||||
}
|
||||
err = l.Destroy()
|
||||
if err != nil {
|
||||
plog.Errorf("error destroying lock %s when purging file (%v)", l.Name(), err)
|
||||
errC <- err
|
||||
return
|
||||
}
|
||||
plog.Infof("purged file %s successfully", f)
|
||||
newfnames = newfnames[1:]
|
||||
|
Loading…
x
Reference in New Issue
Block a user