From f006f3b342e98bf6c4fa22616e3252588db2d2c6 Mon Sep 17 00:00:00 2001
From: Pavel Karpy
Date: Wed, 15 Mar 2023 03:42:49 +0300
Subject: [PATCH] [#67] node: Make engine's `IsLocked` public
It will allow reusing that method in expiration checks.
Signed-off-by: Pavel Karpy
---
pkg/local_object_storage/engine/inhume.go | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/pkg/local_object_storage/engine/inhume.go b/pkg/local_object_storage/engine/inhume.go
index 13aa9094c..151820ab2 100644
--- a/pkg/local_object_storage/engine/inhume.go
+++ b/pkg/local_object_storage/engine/inhume.go
@@ -81,7 +81,7 @@ func (e *StorageEngine) inhume(prm InhumePrm) (InhumeRes, error) {
for i := range prm.addrs {
if !prm.forceRemoval {
- locked, err := e.isLocked(prm.addrs[i])
+ locked, err := e.IsLocked(prm.addrs[i])
if err != nil {
e.log.Warn("removing an object without full locking check",
zap.Error(err),
@@ -179,7 +179,8 @@ func (e *StorageEngine) inhumeAddr(addr oid.Address, prm shard.InhumePrm, checkE
return ok, retErr
}
-func (e *StorageEngine) isLocked(addr oid.Address) (bool, error) {
+// IsLocked checks whether an object is locked according to StorageEngine's state.
+func (e *StorageEngine) IsLocked(addr oid.Address) (bool, error) {
var locked bool
var err error
var outErr error