[#1632] node: Configure TTL of Sidechain caches

From now cache TTL can be parameterized in the `neofs-node` app using
`cache_ttl` config key. `disable_cache` value is no longer supported.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2022-08-16 15:59:30 +04:00 committed by LeL
parent 5ce8315cd8
commit fa3124fc33
9 changed files with 35 additions and 33 deletions

View file

@ -86,9 +86,9 @@ func initMorphComponents(c *cfg) {
var netmapSource netmap.Source
c.cfgMorph.disableCache = morphconfig.DisableCache(c.appCfg)
c.cfgMorph.cacheTTL = morphconfig.CacheTTL(c.appCfg)
if c.cfgMorph.disableCache {
if c.cfgMorph.cacheTTL <= 0 {
netmapSource = wrap
} else {
// use RPC node as source of netmap (with caching)