[#1693] services: Replace conditional panics with asserts
Change-Id: Ic79609e6ad867caa88ad245b3014aa7fc32e05a8 Signed-off-by: Ekaterina Lebedeva <ekaterina.lebedeva@yadro.com>
This commit is contained in:
parent
fc6abe30b8
commit
bc045b29e2
4 changed files with 14 additions and 13 deletions
|
@ -3,6 +3,7 @@ package tombstone
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/internal/assert"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/util/logger"
|
||||
lru "github.com/hashicorp/golang-lru/v2"
|
||||
"go.uber.org/zap"
|
||||
|
@ -49,9 +50,7 @@ func NewChecker(oo ...Option) *ExpirationChecker {
|
|||
panicOnNil(cfg.tsSource, "Tombstone source")
|
||||
|
||||
cache, err := lru.New[string, uint64](cfg.cacheSize)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("could not create LRU cache with %d size: %w", cfg.cacheSize, err))
|
||||
}
|
||||
assert.NoError(err, fmt.Sprintf("could not create LRU cache with %d size", cfg.cacheSize))
|
||||
|
||||
return &ExpirationChecker{
|
||||
cache: cache,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue