[#98] fstree: Do not fail iteration over just removed files #157
2 changed files with 7 additions and 3 deletions
|
@ -50,6 +50,7 @@ Changelog for FrostFS Node
|
||||||
- Actually use `object.put.pool_size_local` and independent pool for local puts (#64).
|
- Actually use `object.put.pool_size_local` and independent pool for local puts (#64).
|
||||||
- Pretty printer of basic ACL in the NeoFS CLI (#2259)
|
- Pretty printer of basic ACL in the NeoFS CLI (#2259)
|
||||||
- Adding of public key for nns group `group.frostfs` at init step (#130)
|
- Adding of public key for nns group `group.frostfs` at init step (#130)
|
||||||
|
- Iterating over just removed files by FSTree (#98)
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
### Updated
|
### Updated
|
||||||
|
|
|
@ -135,13 +135,16 @@ func (t *FSTree) iterate(depth uint64, curPath []string, prm common.IteratePrm)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
data, err := os.ReadFile(filepath.Join(curPath...))
|
||||||
|
if err != nil && os.IsNotExist(err) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
if prm.LazyHandler != nil {
|
if prm.LazyHandler != nil {
|
||||||
err = prm.LazyHandler(addr, func() ([]byte, error) {
|
err = prm.LazyHandler(addr, func() ([]byte, error) {
|
||||||
return os.ReadFile(filepath.Join(curPath...))
|
return data, err
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
var data []byte
|
|
||||||
data, err = os.ReadFile(filepath.Join(curPath...))
|
|
||||||
if err == nil {
|
if err == nil {
|
||||||
data, err = t.Decompress(data)
|
data, err = t.Decompress(data)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue