From ac0a278a05686c83e39016b33a24237d2f0f39e2 Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Thu, 9 Mar 2023 11:16:38 +0300 Subject: [PATCH] [#85] get-service: Drop unused assemble flag Signed-off-by: Dmitrii Stepanov --- pkg/services/object/get/exec.go | 2 +- pkg/services/object/get/get_test.go | 3 --- pkg/services/object/get/service.go | 10 ---------- 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/pkg/services/object/get/exec.go b/pkg/services/object/get/exec.go index ac26eac34b..c843e9b170 100644 --- a/pkg/services/object/get/exec.go +++ b/pkg/services/object/get/exec.go @@ -115,7 +115,7 @@ func (exec execCtx) key() (*ecdsa.PrivateKey, error) { } func (exec *execCtx) canAssemble() bool { - return exec.svc.assembly && !exec.isRaw() && !exec.headOnly() && !exec.isLocal() + return !exec.isRaw() && !exec.headOnly() && !exec.isLocal() } func (exec *execCtx) splitInfo() *objectSDK.SplitInfo { diff --git a/pkg/services/object/get/get_test.go b/pkg/services/object/get/get_test.go index 530e7054d2..09d0c38faa 100644 --- a/pkg/services/object/get/get_test.go +++ b/pkg/services/object/get/get_test.go @@ -248,7 +248,6 @@ func TestGetLocalOnly(t *testing.T) { svc := &Service{cfg: new(cfg)} svc.log = test.NewLogger(false) svc.localStorage = storage - svc.assembly = true return svc } @@ -510,7 +509,6 @@ func TestGetRemoteSmall(t *testing.T) { svc := &Service{cfg: new(cfg)} svc.log = test.NewLogger(false) svc.localStorage = newTestStorage() - svc.assembly = true const curEpoch = 13 @@ -1644,7 +1642,6 @@ func TestGetFromPastEpoch(t *testing.T) { svc := &Service{cfg: new(cfg)} svc.log = test.NewLogger(false) svc.localStorage = newTestStorage() - svc.assembly = true const curEpoch = 13 diff --git a/pkg/services/object/get/service.go b/pkg/services/object/get/service.go index 123c67b3e4..e69ab4f0f6 100644 --- a/pkg/services/object/get/service.go +++ b/pkg/services/object/get/service.go @@ -26,8 +26,6 @@ type getClient interface { } type cfg struct { - assembly bool - log *logger.Logger localStorage interface { @@ -51,7 +49,6 @@ type cfg struct { func defaultCfg() *cfg { return &cfg{ - assembly: true, log: &logger.Logger{Logger: zap.L()}, localStorage: new(storageEngineWrapper), clientCache: new(clientCacheWrapper), @@ -79,13 +76,6 @@ func WithLogger(l *logger.Logger) Option { } } -// WithoutAssembly returns option to disable object assembling. -func WithoutAssembly() Option { - return func(c *cfg) { - c.assembly = false - } -} - // WithLocalStorageEngine returns option to set local storage // instance. func WithLocalStorageEngine(e *engine.StorageEngine) Option {