forked from TrueCloudLab/frostfs-node
[#1555] engine: Refactor (*StorageEngine).GetLocks
Refactored after renaming the method to replace the confusing `locked` variable with `locks`. Signed-off-by: Aleksey Savchuk <a.savchuk@yadro.com>
This commit is contained in:
parent
72470d6b48
commit
3821645085
1 changed files with 6 additions and 6 deletions
|
@ -262,23 +262,23 @@ func (e *StorageEngine) GetLocks(ctx context.Context, addr oid.Address) ([]oid.I
|
|||
))
|
||||
defer span.End()
|
||||
|
||||
var locked []oid.ID
|
||||
var allLocks []oid.ID
|
||||
var outErr error
|
||||
|
||||
e.iterateOverUnsortedShards(func(h hashedShard) (stop bool) {
|
||||
ld, err := h.Shard.GetLocks(ctx, addr)
|
||||
locks, err := h.Shard.GetLocks(ctx, addr)
|
||||
if err != nil {
|
||||
e.reportShardError(ctx, h, logs.EngineInterruptGettingLockers, err, zap.Stringer("address", addr),
|
||||
zap.String("trace_id", tracingPkg.GetTraceID(ctx)))
|
||||
outErr = err
|
||||
}
|
||||
locked = append(locked, ld...)
|
||||
allLocks = append(allLocks, locks...)
|
||||
return false
|
||||
})
|
||||
if len(locked) > 0 {
|
||||
return locked, nil
|
||||
if len(allLocks) > 0 {
|
||||
return allLocks, nil
|
||||
}
|
||||
return locked, outErr
|
||||
return allLocks, outErr
|
||||
}
|
||||
|
||||
func (e *StorageEngine) processExpiredTombstones(ctx context.Context, addrs []meta.TombstonedObject) {
|
||||
|
|
Loading…
Reference in a new issue