Add "redis_" prefix to "dataDB" option for redis

This commit is contained in:
TeoV
2020-10-14 17:43:05 +03:00
committed by Dan Christian Bogos
parent a17b7d644f
commit 21120eb9b6
15 changed files with 115 additions and 88 deletions

View File

@@ -59,9 +59,9 @@ var (
"The name of redis sentinel")
dbRedisCluster = cgrLoaderFlags.Bool("redis_cluster", false,
"Is the redis datadb a cluster")
dbRedisClusterSync = cgrLoaderFlags.String("cluster_sync", utils.IfaceAsString(dfltCfg.DataDbCfg().Opts[utils.ClusterSyncCfg]),
dbRedisClusterSync = cgrLoaderFlags.String("redis_cluster_sync", utils.IfaceAsString(dfltCfg.DataDbCfg().Opts[utils.RedisClusterSyncCfg]),
"The sync interval for the redis cluster")
dbRedisClusterDownDelay = cgrLoaderFlags.String("cluster_ondown_delay", utils.IfaceAsString(dfltCfg.DataDbCfg().Opts[utils.ClusterOnDownDelayCfg]),
dbRedisClusterDownDelay = cgrLoaderFlags.String("redis_cluster_ondown_delay", utils.IfaceAsString(dfltCfg.DataDbCfg().Opts[utils.RedisClusterOnDownDelayCfg]),
"The delay before executing the commands if the redis cluster is in the CLUSTERDOWN state")
dbQueryTimeout = cgrLoaderFlags.String("query_timeout", utils.IfaceAsString(dfltCfg.DataDbCfg().Opts[utils.QueryTimeoutCfg]),
"The timeout for queries")
@@ -152,11 +152,11 @@ func loadConfig() (ldrCfg *config.CGRConfig) {
if *dbRedisCluster != rdsCls {
ldrCfg.DataDbCfg().Opts[utils.RedisClusterCfg] = *dbRedisCluster
}
if *dbRedisClusterSync != utils.IfaceAsString(dfltCfg.DataDbCfg().Opts[utils.ClusterSyncCfg]) {
ldrCfg.DataDbCfg().Opts[utils.ClusterSyncCfg] = *dbRedisClusterSync
if *dbRedisClusterSync != utils.IfaceAsString(dfltCfg.DataDbCfg().Opts[utils.RedisClusterSyncCfg]) {
ldrCfg.DataDbCfg().Opts[utils.RedisClusterSyncCfg] = *dbRedisClusterSync
}
if *dbRedisClusterDownDelay != utils.IfaceAsString(dfltCfg.DataDbCfg().Opts[utils.ClusterOnDownDelayCfg]) {
ldrCfg.DataDbCfg().Opts[utils.ClusterOnDownDelayCfg] = *dbRedisClusterDownDelay
if *dbRedisClusterDownDelay != utils.IfaceAsString(dfltCfg.DataDbCfg().Opts[utils.RedisClusterOnDownDelayCfg]) {
ldrCfg.DataDbCfg().Opts[utils.RedisClusterOnDownDelayCfg] = *dbRedisClusterDownDelay
}
if *dbQueryTimeout != utils.IfaceAsString(dfltCfg.DataDbCfg().Opts[utils.QueryTimeoutCfg]) {
ldrCfg.DataDbCfg().Opts[utils.QueryTimeoutCfg] = *dbQueryTimeout

View File

@@ -57,11 +57,11 @@ func TestLoadConfig(t *testing.T) {
DataDbUser: "cgrates2",
DataDbPass: "toor",
Opts: map[string]interface{}{
utils.RedisSentinelNameCfg: "sentinel1",
utils.QueryTimeoutCfg: "10s",
utils.ClusterSyncCfg: "5s",
utils.ClusterOnDownDelayCfg: "0",
utils.RedisClusterCfg: false,
utils.RedisSentinelNameCfg: "sentinel1",
utils.QueryTimeoutCfg: "10s",
utils.RedisClusterSyncCfg: "5s",
utils.RedisClusterOnDownDelayCfg: "0",
utils.RedisClusterCfg: false,
},
RmtConns: []string{},
RplConns: []string{},

View File

@@ -67,9 +67,9 @@ var (
"the name of redis sentinel")
dbRedisCluster = cgrMigratorFlags.Bool("redis_cluster", false,
"Is the redis datadb a cluster")
dbRedisClusterSync = cgrMigratorFlags.String("cluster_sync", utils.IfaceAsString(dfltCfg.DataDbCfg().Opts[utils.ClusterSyncCfg]),
dbRedisClusterSync = cgrMigratorFlags.String("redis_cluster_sync", utils.IfaceAsString(dfltCfg.DataDbCfg().Opts[utils.RedisClusterSyncCfg]),
"The sync interval for the redis cluster")
dbRedisClusterDownDelay = cgrMigratorFlags.String("cluster_ondown_delay", utils.IfaceAsString(dfltCfg.DataDbCfg().Opts[utils.ClusterOnDownDelayCfg]),
dbRedisClusterDownDelay = cgrMigratorFlags.String("redis_cluster_ondown_delay", utils.IfaceAsString(dfltCfg.DataDbCfg().Opts[utils.RedisClusterOnDownDelayCfg]),
"The delay before executing the commands if the redis cluster is in the CLUSTERDOWN state")
dbQueryTimeout = cgrMigratorFlags.String("query_timeout", utils.IfaceAsString(dfltCfg.DataDbCfg().Opts[utils.QueryTimeoutCfg]),
"The timeout for queries")
@@ -172,11 +172,11 @@ func main() {
if *dbRedisCluster != rdsCls {
mgrCfg.DataDbCfg().Opts[utils.RedisClusterCfg] = *dbRedisCluster
}
if *dbRedisClusterSync != utils.IfaceAsString(dfltCfg.DataDbCfg().Opts[utils.ClusterSyncCfg]) {
mgrCfg.DataDbCfg().Opts[utils.ClusterSyncCfg] = *dbRedisClusterSync
if *dbRedisClusterSync != utils.IfaceAsString(dfltCfg.DataDbCfg().Opts[utils.RedisClusterSyncCfg]) {
mgrCfg.DataDbCfg().Opts[utils.RedisClusterSyncCfg] = *dbRedisClusterSync
}
if *dbRedisClusterDownDelay != utils.IfaceAsString(dfltCfg.DataDbCfg().Opts[utils.ClusterOnDownDelayCfg]) {
mgrCfg.DataDbCfg().Opts[utils.ClusterOnDownDelayCfg] = *dbRedisClusterDownDelay
if *dbRedisClusterDownDelay != utils.IfaceAsString(dfltCfg.DataDbCfg().Opts[utils.RedisClusterOnDownDelayCfg]) {
mgrCfg.DataDbCfg().Opts[utils.RedisClusterOnDownDelayCfg] = *dbRedisClusterDownDelay
}
if *dbQueryTimeout != utils.IfaceAsString(dfltCfg.DataDbCfg().Opts[utils.QueryTimeoutCfg]) {
mgrCfg.DataDbCfg().Opts[utils.QueryTimeoutCfg] = *dbQueryTimeout

View File

@@ -57,9 +57,9 @@ var (
redisSentinel = cgrTesterFlags.String("redis_sentinel", utils.IfaceAsString(cgrConfig.DataDbCfg().Opts[utils.RedisSentinelNameCfg]), "The name of redis sentinel")
dbRedisCluster = cgrTesterFlags.Bool("redis_cluster", false,
"Is the redis datadb a cluster")
dbRedisClusterSync = cgrTesterFlags.String("cluster_sync", utils.IfaceAsString(cgrConfig.DataDbCfg().Opts[utils.ClusterSyncCfg]),
dbRedisClusterSync = cgrTesterFlags.String("redis_cluster_sync", utils.IfaceAsString(cgrConfig.DataDbCfg().Opts[utils.RedisClusterSyncCfg]),
"The sync interval for the redis cluster")
dbRedisClusterDownDelay = cgrTesterFlags.String("cluster_ondown_delay", utils.IfaceAsString(cgrConfig.DataDbCfg().Opts[utils.ClusterOnDownDelayCfg]),
dbRedisClusterDownDelay = cgrTesterFlags.String("redis_cluster_ondown_delay", utils.IfaceAsString(cgrConfig.DataDbCfg().Opts[utils.RedisClusterOnDownDelayCfg]),
"The delay before executing the commands if the redis cluster is in the CLUSTERDOWN state")
dbQueryTimeout = cgrTesterFlags.String("query_timeout", utils.IfaceAsString(cgrConfig.DataDbCfg().Opts[utils.QueryTimeoutCfg]),
"The timeout for queries")
@@ -208,11 +208,11 @@ func main() {
if *dbRedisCluster != rdsCls {
tstCfg.DataDbCfg().Opts[utils.RedisClusterCfg] = *dbRedisCluster
}
if *dbRedisClusterSync != utils.IfaceAsString(cgrConfig.DataDbCfg().Opts[utils.ClusterSyncCfg]) {
tstCfg.DataDbCfg().Opts[utils.ClusterSyncCfg] = *dbRedisClusterSync
if *dbRedisClusterSync != utils.IfaceAsString(cgrConfig.DataDbCfg().Opts[utils.RedisClusterSyncCfg]) {
tstCfg.DataDbCfg().Opts[utils.RedisClusterSyncCfg] = *dbRedisClusterSync
}
if *dbRedisClusterDownDelay != utils.IfaceAsString(cgrConfig.DataDbCfg().Opts[utils.ClusterOnDownDelayCfg]) {
tstCfg.DataDbCfg().Opts[utils.ClusterOnDownDelayCfg] = *dbRedisClusterDownDelay
if *dbRedisClusterDownDelay != utils.IfaceAsString(cgrConfig.DataDbCfg().Opts[utils.RedisClusterOnDownDelayCfg]) {
tstCfg.DataDbCfg().Opts[utils.RedisClusterOnDownDelayCfg] = *dbRedisClusterDownDelay
}
if *dbQueryTimeout != utils.IfaceAsString(cgrConfig.DataDbCfg().Opts[utils.QueryTimeoutCfg]) {
tstCfg.DataDbCfg().Opts[utils.QueryTimeoutCfg] = *dbQueryTimeout

View File

@@ -104,9 +104,10 @@ const CGRATES_CFG_JSON = `
"opts":{
"redis_sentinel": "", // the name of sentinel when used
"redis_cluster": false, // if enabled the datadb will try to connect to the redis cluster
"cluster_sync": "5s", // the sync interval for the redis cluster
"cluster_ondown_delay": "0", // the delay before executing the commands if the redis cluster is in the CLUSTERDOWN state
"redis_cluster_sync": "5s", // the sync interval for the redis cluster
"redis_cluster_ondown_delay": "0", // the delay before executing the commands if the redis cluster is in the CLUSTERDOWN state
"query_timeout":"10s",
"redis_tls": false, // if true it will use a tls connection and use the client certificate, key and ca_certificate for tls connection
}
},
@@ -871,8 +872,8 @@ const CGRATES_CFG_JSON = `
"out_datadb_opts":{
"redis_sentinel": "",
"redis_cluster": false,
"cluster_sync": "5s",
"cluster_ondown_delay": "0",
"redis_cluster_sync": "5s",
"redis_cluster_ondown_delay": "0",
},
"out_stordb_opts":{},
},

View File

@@ -331,11 +331,12 @@ func TestDfDataDbJsonCfg(t *testing.T) {
Replication_conns: &[]string{},
Remote_conns: &[]string{},
Opts: map[string]interface{}{
utils.RedisSentinelNameCfg: "",
utils.QueryTimeoutCfg: "10s",
utils.RedisClusterCfg: false,
utils.ClusterOnDownDelayCfg: "0",
utils.ClusterSyncCfg: "5s",
utils.RedisSentinelNameCfg: "",
utils.QueryTimeoutCfg: "10s",
utils.RedisClusterCfg: false,
utils.RedisClusterOnDownDelayCfg: "0",
utils.RedisClusterSyncCfg: "5s",
utils.RedisTLS: false,
},
Items: &map[string]*ItemOptJson{
utils.MetaAccounts: {
@@ -1628,10 +1629,10 @@ func TestDfMigratorCfg(t *testing.T) {
Users_filters: &[]string{},
Out_storDB_opts: make(map[string]interface{}),
Out_dataDB_opts: map[string]interface{}{
utils.RedisSentinelNameCfg: "",
utils.RedisClusterCfg: false,
utils.ClusterSyncCfg: "5s",
utils.ClusterOnDownDelayCfg: "0",
utils.RedisSentinelNameCfg: "",
utils.RedisClusterCfg: false,
utils.RedisClusterSyncCfg: "5s",
utils.RedisClusterOnDownDelayCfg: "0",
},
}
if cfg, err := dfCgrJSONCfg.MigratorCfgJson(); err != nil {

View File

@@ -1732,10 +1732,10 @@ func TestCgrMigratorCfgDefault(t *testing.T) {
OutStorDBUser: "cgrates",
OutStorDBPassword: "",
OutDataDBOpts: map[string]interface{}{
utils.ClusterOnDownDelayCfg: "0",
utils.ClusterSyncCfg: "5s",
utils.RedisClusterCfg: false,
utils.RedisSentinelNameCfg: "",
utils.RedisClusterOnDownDelayCfg: "0",
utils.RedisClusterSyncCfg: "5s",
utils.RedisClusterCfg: false,
utils.RedisSentinelNameCfg: "",
},
OutStorDBOpts: make(map[string]interface{}),
}

View File

@@ -40,8 +40,8 @@ func TestMigratorCgrCfgloadFromJsonCfg(t *testing.T) {
Out_storDB_user: utils.StringPointer(utils.CGRATES),
Out_storDB_password: utils.StringPointer(utils.EmptyString),
Out_dataDB_opts: map[string]interface{}{
utils.RedisClusterCfg: true,
utils.ClusterSyncCfg: "10s",
utils.RedisClusterCfg: true,
utils.RedisClusterSyncCfg: "10s",
},
Out_storDB_opts: map[string]interface{}{
utils.RedisClusterCfg: true,
@@ -62,10 +62,10 @@ func TestMigratorCgrCfgloadFromJsonCfg(t *testing.T) {
OutStorDBUser: utils.CGRATES,
OutStorDBPassword: utils.EmptyString,
OutDataDBOpts: map[string]interface{}{
utils.RedisSentinelNameCfg: utils.EmptyString,
utils.RedisClusterCfg: true,
utils.ClusterSyncCfg: "10s",
utils.ClusterOnDownDelayCfg: "0",
utils.RedisSentinelNameCfg: utils.EmptyString,
utils.RedisClusterCfg: true,
utils.RedisClusterSyncCfg: "10s",
utils.RedisClusterOnDownDelayCfg: "0",
},
OutStorDBOpts: map[string]interface{}{
utils.RedisClusterCfg: true,
@@ -91,8 +91,8 @@ func TestMigratorCgrCfgAsMapInterface(t *testing.T) {
"users_filters":["users","filters","Account"],
"out_datadb_opts":{
"redis_cluster": true,
"cluster_sync": "2s",
"cluster_ondown_delay": "1",
"redis_cluster_sync": "2s",
"redis_cluster_ondown_delay": "1",
},
},
}`
@@ -113,10 +113,10 @@ func TestMigratorCgrCfgAsMapInterface(t *testing.T) {
utils.UsersFiltersCfg: []string{"users", "filters", "Account"},
utils.OutStorDBOptsCfg: map[string]interface{}{},
utils.OutDataDBOptsCfg: map[string]interface{}{
utils.RedisSentinelNameCfg: "",
utils.RedisClusterCfg: true,
utils.ClusterSyncCfg: "2s",
utils.ClusterOnDownDelayCfg: "1",
utils.RedisSentinelNameCfg: "",
utils.RedisClusterCfg: true,
utils.RedisClusterSyncCfg: "2s",
utils.RedisClusterOnDownDelayCfg: "1",
},
}
if cgrCfg, err := NewCGRConfigFromJSONStringWithDefaults(cfgJSONStr); err != nil {
@@ -152,10 +152,10 @@ func TestMigratorCgrCfgAsMapInterface1(t *testing.T) {
utils.UsersFiltersCfg: []string{"users", "filters", "Account"},
utils.OutStorDBOptsCfg: map[string]interface{}{},
utils.OutDataDBOptsCfg: map[string]interface{}{
utils.RedisSentinelNameCfg: "out_datadb_redis_sentinel",
utils.RedisClusterCfg: false,
utils.ClusterSyncCfg: "5s",
utils.ClusterOnDownDelayCfg: "0",
utils.RedisSentinelNameCfg: "out_datadb_redis_sentinel",
utils.RedisClusterCfg: false,
utils.RedisClusterSyncCfg: "5s",
utils.RedisClusterOnDownDelayCfg: "0",
},
}
if cgrCfg, err := NewCGRConfigFromJSONStringWithDefaults(cfgJSONStr); err != nil {
@@ -186,10 +186,10 @@ func TestMigratorCgrCfgAsMapInterface2(t *testing.T) {
utils.UsersFiltersCfg: []string{},
utils.OutStorDBOptsCfg: map[string]interface{}{},
utils.OutDataDBOptsCfg: map[string]interface{}{
utils.RedisSentinelNameCfg: "",
utils.RedisClusterCfg: false,
utils.ClusterSyncCfg: "5s",
utils.ClusterOnDownDelayCfg: "0",
utils.RedisSentinelNameCfg: "",
utils.RedisClusterCfg: false,
utils.RedisClusterSyncCfg: "5s",
utils.RedisClusterOnDownDelayCfg: "0",
},
}
if cgrCfg, err := NewCGRConfigFromJSONStringWithDefaults(cfgJSONStr); err != nil {

View File

@@ -83,9 +83,10 @@
// "opts":{
// "redis_sentinel": "", // the name of sentinel when used
// "redis_cluster": false, // if enabled the datadb will try to connect to the redis cluster
// "cluster_sync": "5s", // the sync interval for the redis cluster
// "cluster_ondown_delay": "0", // the delay before executing the commands if the redis cluster is in the CLUSTERDOWN state
// "redis_cluster_sync": "5s", // the sync interval for the redis cluster
// "redis_cluster_ondown_delay": "0", // the delay before executing the commands if the redis cluster is in the CLUSTERDOWN state
// "query_timeout":"10s",
// "redis_tls": false, // if true it will use a tls connection and use the client certificate, key and ca_certificate for tls connection
// }
// },
@@ -222,6 +223,7 @@
// "*rpc_connections": {"limit": -1, "ttl": "", "static_ttl": false, "replicate": false}, // RPC connections caching
// "*uch": {"limit": -1, "ttl": "3h", "static_ttl": false, "replicate": false}, // User cache
// "*stir": {"limit": -1, "ttl": "3h", "static_ttl": false, "replicate": false}, // stirShaken cache keys
// "*apiban":{"limit": -1, "ttl": "2m", "static_ttl": false, "replicate": false},
// // only for *internal database
// "*versions": {"limit": -1, "ttl": "", "static_ttl": false, "replicate": false}, // for version storing
@@ -316,6 +318,7 @@
// "concurrent_requests": 1024, // maximum simultaneous requests/files to process, 0 for unlimited
// "source_path": "/var/spool/cgrates/ers/in", // read data from this path
// "processed_path": "/var/spool/cgrates/ers/out", // move processed data here
// "opts": {},
// "xml_root_path": "", // path towards one event in case of XML CDRs
// "tenant": "", // tenant used by import
// "timezone": "", // timezone for timestamps where not specified <""|UTC|Local|$IANA_TZ_DB>
@@ -351,6 +354,7 @@
// "id": "*default", // identifier of the EventReader profile
// "type": "*none", // exporter type
// "export_path": "/var/spool/cgrates/ees", // path where the exported events will be placed
// "opts": {}, // extra options for exporter
// "tenant": "", // tenant used in filterS.Pass
// "timezone": "", // timezone for timestamps where not specified <""|UTC|Local|$IANA_TZ_DB>
// "filters": [], // limit parsing based on the filters
@@ -512,7 +516,10 @@
// "attributes": { // AttributeS config
// "enabled": false, // starts attribute service: <true|false>.
// "enabled": false, // starts attribute service: <true|false>
// "stats_conns": [], // connections to StatS, empty to disable: <""|*internal|$rpc_conns_id>
// "resources_conns": [], // connections to ResourceS, empty to disable: <""|*internal|$rpc_conns_id>
// "apiers_conns": [], // connections to ApierS, empty to disable: <""|*internal|$rpc_conns_id>
// "indexed_selects": true, // enable profile matching exclusively on indexes
// //"string_indexed_fields": [], // query indexes based on these fields for faster processing
// "prefix_indexed_fields": [], // query indexes based on these fields for faster processing
@@ -844,8 +851,8 @@
// "out_datadb_opts":{
// "redis_sentinel": "",
// "redis_cluster": false,
// "cluster_sync": "5s",
// "cluster_ondown_delay": "0",
// "redis_cluster_sync": "5s",
// "redis_cluster_ondown_delay": "0",
// },
// "out_stordb_opts":{},
// },
@@ -880,6 +887,7 @@
// "caches_conns":["*internal"],
// "scheduler_conns": [], // connections to SchedulerS for reloads
// "attributes_conns": [], // connections to AttributeS for CDRExporter
// "ees_conns": [], // connections to EEs
// },
@@ -893,10 +901,11 @@
// "rate_indexed_selects": true, // enable profile matching exclusively on indexes
// //"rate_string_indexed_fields": [], // query indexes based on these fields for faster processing
// "rate_prefix_indexed_fields": [], // query indexes based on these fields for faster processing
// "rate_suffix_indexed_fields": [], // query indexes based on these fields for faster processing
// "rate_suffix_indexed_fields": [], // query indexes based on these fields for faster processing
// "rate_nested_fields": false, // determines which field is checked when matching indexed filters(true: all; false: only the one on the first level)
// },
// "sip_agent": { // SIP Agents, only used for redirections
// "enabled": false, // enables the SIP agent: <true|false>
// "listen": "127.0.0.1:5060", // address where to listen for SIP requests <x.y.z.y:1234>
@@ -908,6 +917,7 @@
// ],
// },
// "templates": {
// "*err": [
// {"tag": "SessionId", "path": "*rep.Session-Id", "type": "*variable",
@@ -969,4 +979,17 @@
// ],
// },
// "configs": {
// "enabled": false,
// "url": "/configs/", // configs url
// "root_dir": "/var/spool/cgrates/configs", // root directory in case of calling /configs request
// },
// "apiban": {
// "enabled": false,
// "keys": [],
// },
}

View File

@@ -21,7 +21,7 @@
"db_name": "10", // data_db database name to connect to
"opts": {
"redis_cluster": true,
"cluster_sync": "100ms", // the sync interval for the redis cluster
"redis_cluster_sync": "100ms", // the sync interval for the redis cluster
},
},

View File

@@ -48,10 +48,10 @@ func NewDataDBConn(dbType, host, port, name, user,
return
}
var clusterSync, clusterOnDownDelay time.Duration
if clusterSync, err = utils.IfaceAsDuration(opts[utils.ClusterSyncCfg]); err != nil {
if clusterSync, err = utils.IfaceAsDuration(opts[utils.RedisClusterSyncCfg]); err != nil {
return
}
if clusterOnDownDelay, err = utils.IfaceAsDuration(opts[utils.ClusterOnDownDelayCfg]); err != nil {
if clusterOnDownDelay, err = utils.IfaceAsDuration(opts[utils.RedisClusterOnDownDelayCfg]); err != nil {
return
}
d, err = NewRedisStorage(host, dbNo, user, pass, marshaler,

View File

@@ -110,6 +110,7 @@ cgrates (0.11.0~dev) UNRELEASED; urgency=medium
* [Templates] Added new data converter: *unixtime
* [ActionsS] Add prefix *acnt and *act to cdrLog action
* [AttributeS] Add support for *prefix and *suffix type
* [ConfigS] Add "redis_" prefix to "dataDB" option for redis
-- DanB <danb@cgrates.org> Wed, 19 Feb 2020 13:25:52 +0200

View File

@@ -160,8 +160,8 @@ func (db *DataDBService) needsConnectionReload() bool {
return db.oldDBCfg.DataDbType == utils.REDIS &&
(db.oldDBCfg.Opts[utils.RedisSentinelNameCfg] != db.cfg.DataDbCfg().Opts[utils.RedisSentinelNameCfg] ||
db.oldDBCfg.Opts[utils.RedisClusterCfg] != db.cfg.DataDbCfg().Opts[utils.RedisClusterCfg] ||
db.oldDBCfg.Opts[utils.ClusterSyncCfg] != db.cfg.DataDbCfg().Opts[utils.ClusterSyncCfg] ||
db.oldDBCfg.Opts[utils.ClusterOnDownDelayCfg] != db.cfg.DataDbCfg().Opts[utils.ClusterOnDownDelayCfg])
db.oldDBCfg.Opts[utils.RedisClusterSyncCfg] != db.cfg.DataDbCfg().Opts[utils.RedisClusterSyncCfg] ||
db.oldDBCfg.Opts[utils.RedisClusterOnDownDelayCfg] != db.cfg.DataDbCfg().Opts[utils.RedisClusterOnDownDelayCfg])
}
// GetDMChan returns the DataManager chanel

View File

@@ -81,11 +81,11 @@ func TestDataDBReload(t *testing.T) {
DataDbName: "10",
DataDbUser: "cgrates",
Opts: map[string]interface{}{
utils.QueryTimeoutCfg: "10s",
utils.ClusterOnDownDelayCfg: "0",
utils.ClusterSyncCfg: "5s",
utils.RedisClusterCfg: false,
utils.RedisSentinelNameCfg: "",
utils.QueryTimeoutCfg: "10s",
utils.RedisClusterOnDownDelayCfg: "0",
utils.RedisClusterSyncCfg: "5s",
utils.RedisClusterCfg: false,
utils.RedisSentinelNameCfg: "",
},
RmtConns: []string{},
RplConns: []string{},

View File

@@ -1912,18 +1912,19 @@ const (
// DataDbCfg
const (
DataDbTypeCfg = "db_type"
DataDbHostCfg = "db_host"
DataDbPortCfg = "db_port"
DataDbNameCfg = "db_name"
DataDbUserCfg = "db_user"
DataDbPassCfg = "db_password"
RedisSentinelNameCfg = "redis_sentinel"
RmtConnsCfg = "remote_conns"
RplConnsCfg = "replication_conns"
RedisClusterCfg = "redis_cluster"
ClusterSyncCfg = "cluster_sync"
ClusterOnDownDelayCfg = "cluster_ondown_delay"
DataDbTypeCfg = "db_type"
DataDbHostCfg = "db_host"
DataDbPortCfg = "db_port"
DataDbNameCfg = "db_name"
DataDbUserCfg = "db_user"
DataDbPassCfg = "db_password"
RedisSentinelNameCfg = "redis_sentinel"
RmtConnsCfg = "remote_conns"
RplConnsCfg = "replication_conns"
RedisClusterCfg = "redis_cluster"
RedisClusterSyncCfg = "redis_cluster_sync"
RedisClusterOnDownDelayCfg = "redis_cluster_ondown_delay"
RedisTLS = "redis_tls"
)
// ItemOpt