forked from TrueCloudLab/frostfs-node
[#655] storage: Drop ErrorHandler
The only one usage was for logging. Now logging performed by storage anyway. Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
137e987a4e
commit
29fe8c41f3
7 changed files with 45 additions and 20 deletions
|
@ -40,7 +40,14 @@ func (b *BlobStor) Iterate(ctx context.Context, prm common.IteratePrm) (common.I
|
|||
|
||||
for i := range b.storage {
|
||||
_, err := b.storage[i].Storage.Iterate(ctx, prm)
|
||||
if err != nil && !prm.IgnoreErrors {
|
||||
if err != nil {
|
||||
if prm.IgnoreErrors {
|
||||
b.log.Warn(logs.BlobstorErrorOccurredDuringTheIteration,
|
||||
zap.String("storage_path", b.storage[i].Storage.Path()),
|
||||
zap.String("storage_type", b.storage[i].Storage.Type()),
|
||||
zap.String("err", err.Error()))
|
||||
continue
|
||||
}
|
||||
return common.IterateRes{}, fmt.Errorf("blobstor iterator failure: %w", err)
|
||||
}
|
||||
}
|
||||
|
@ -57,12 +64,6 @@ func IterateBinaryObjects(ctx context.Context, blz *BlobStor, f func(addr oid.Ad
|
|||
return f(elem.Address, elem.ObjectData, elem.StorageID)
|
||||
}
|
||||
prm.IgnoreErrors = true
|
||||
prm.ErrorHandler = func(addr oid.Address, err error) error {
|
||||
blz.log.Warn(logs.BlobstorErrorOccurredDuringTheIteration,
|
||||
zap.Stringer("address", addr),
|
||||
zap.String("err", err.Error()))
|
||||
return nil
|
||||
}
|
||||
|
||||
_, err := blz.Iterate(ctx, prm)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue