forked from TrueCloudLab/frostfs-node
[#922] engine: Change interface of container operations
Add `error` to return. Improve docs. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
a537334f33
commit
10f0bd91d6
2 changed files with 60 additions and 48 deletions
|
@ -364,10 +364,21 @@ type localStorageLoad struct {
|
|||
}
|
||||
|
||||
func (d *localStorageLoad) Iterate(f loadcontroller.UsedSpaceFilter, h loadcontroller.UsedSpaceHandler) error {
|
||||
idList := engine.ListContainers(d.engine)
|
||||
idList, err := engine.ListContainers(d.engine)
|
||||
if err != nil {
|
||||
return fmt.Errorf("list containers on engine failure: %w", err)
|
||||
}
|
||||
|
||||
for i := range idList {
|
||||
sz := engine.ContainerSize(d.engine, idList[i])
|
||||
sz, err := engine.ContainerSize(d.engine, idList[i])
|
||||
if err != nil {
|
||||
d.log.Debug("failed to calculate container size in storage engine",
|
||||
zap.Stringer("cid", idList[i]),
|
||||
zap.String("error", err.Error()),
|
||||
)
|
||||
|
||||
continue
|
||||
}
|
||||
|
||||
d.log.Debug("container size in storage engine calculated successfully",
|
||||
zap.Uint64("size", sz),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue