Allow cache to be created for operational data on internal dataDB

This commit is contained in:
arberkatellari
2025-06-04 12:59:53 +02:00
committed by Dan Christian Bogos
parent ec145d778e
commit 9b08994b5e
7 changed files with 30 additions and 35 deletions

View File

@@ -479,8 +479,8 @@ func (cfg *CGRConfig) loadDataDBCfg(jsnCfg *CgrJsonCfg) (err error) {
// in case of internalDB we need to disable the cache
// so we enforce it here
if cfg.dataDbCfg.Type == utils.MetaInternal {
// overwrite only DataDBPartitions and leave other unmodified ( e.g. *diameter_messages, *closed_sessions, etc... )
for key := range utils.DataDBPartitions {
// overwrite only StatelessDataDBPartitions and leave other unmodified ( e.g. *diameter_messages, *closed_sessions, etc... )
for key := range utils.StatelessDataDBPartitions {
if _, has := cfg.cacheCfg.Partitions[key]; has {
cfg.cacheCfg.Partitions[key] = &CacheParamCfg{}
}

View File

@@ -1111,8 +1111,8 @@ func (cfg *CGRConfig) checkConfigSanity() error {
// DataDB sanity checks
if cfg.dataDbCfg.Type == utils.MetaInternal {
for key, config := range cfg.cacheCfg.Partitions {
if utils.DataDBPartitions.Has(key) && config.Limit != 0 {
return fmt.Errorf("<%s> %s needs to be 0 when DataBD is *internal, received : %d", utils.CacheS, key, config.Limit)
if utils.StatelessDataDBPartitions.Has(key) && config.Limit != 0 {
return fmt.Errorf("<%s> %s needs to be 0 when DataBD is *internal and with no persistence, received : %d", utils.CacheS, key, config.Limit)
}
}
if (cfg.dataDbCfg.Opts.InternalDBDumpInterval != 0 ||