mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
changing db type constants with leading *
This commit is contained in:
committed by
Dan Christian Bogos
parent
f9b8fe38b8
commit
5c4bf0e538
@@ -93,7 +93,7 @@ func (db *DataDBService) Reload() (err error) {
|
||||
db.oldDBCfg = db.cfg.DataDbCfg().Clone()
|
||||
return
|
||||
}
|
||||
if db.cfg.DataDbCfg().Type == utils.Mongo {
|
||||
if db.cfg.DataDbCfg().Type == utils.MetaMongo {
|
||||
mgo, canCast := db.dm.DataDB().(*engine.MongoStorage)
|
||||
if !canCast {
|
||||
return fmt.Errorf("can't conver DataDB of type %s to MongoStorage",
|
||||
@@ -165,7 +165,7 @@ func (db *DataDBService) needsConnectionReload() bool {
|
||||
}
|
||||
}
|
||||
}
|
||||
return db.oldDBCfg.Type == utils.Redis &&
|
||||
return db.oldDBCfg.Type == utils.MetaRedis &&
|
||||
(db.oldDBCfg.Opts.RedisMaxConns != db.cfg.DataDbCfg().Opts.RedisMaxConns ||
|
||||
db.oldDBCfg.Opts.RedisConnectAttempts != db.cfg.DataDbCfg().Opts.RedisConnectAttempts ||
|
||||
db.oldDBCfg.Opts.RedisSentinel != db.cfg.DataDbCfg().Opts.RedisSentinel ||
|
||||
|
||||
@@ -83,7 +83,7 @@ func TestDataDBReload(t *testing.T) {
|
||||
t.Errorf("\nExpecting <%+v>,\n Received <%+v>", db.dm, getDm)
|
||||
}
|
||||
oldcfg := &config.DataDbCfg{
|
||||
Type: utils.Mongo,
|
||||
Type: utils.MetaMongo,
|
||||
Host: "127.0.0.1",
|
||||
Port: "27017",
|
||||
Name: "10",
|
||||
@@ -211,7 +211,7 @@ func TestDataDBReloadBadType(t *testing.T) {
|
||||
cM := engine.NewConnManager(cfg, nil)
|
||||
db := NewDataDBService(cfg, cM, srvDep)
|
||||
db.oldDBCfg = &config.DataDbCfg{
|
||||
Type: utils.Mongo,
|
||||
Type: utils.MetaMongo,
|
||||
Host: "127.0.0.1",
|
||||
Port: "27017",
|
||||
Name: "10",
|
||||
@@ -333,7 +333,7 @@ func TestDataDBReloadErrorMarsheler(t *testing.T) {
|
||||
t.Errorf("Expected service to be down")
|
||||
}
|
||||
db.oldDBCfg = &config.DataDbCfg{
|
||||
Type: utils.Mongo,
|
||||
Type: utils.MetaMongo,
|
||||
Host: "127.0.0.1",
|
||||
Port: "27017",
|
||||
Name: "10",
|
||||
@@ -550,7 +550,7 @@ func TestDataDBReloadCastError(t *testing.T) {
|
||||
cM := engine.NewConnManager(cfg, nil)
|
||||
db := NewDataDBService(cfg, cM, srvDep)
|
||||
db.oldDBCfg = &config.DataDbCfg{
|
||||
Type: utils.Mongo,
|
||||
Type: utils.MetaMongo,
|
||||
Host: "127.0.0.1",
|
||||
Port: "27017",
|
||||
Name: "10",
|
||||
@@ -691,7 +691,7 @@ func TestDataDBReloadError(t *testing.T) {
|
||||
db := NewDataDBService(cfg, cM, srvDep)
|
||||
cfg.GeneralCfg().DBDataEncoding = utils.JSON
|
||||
db.oldDBCfg = &config.DataDbCfg{
|
||||
Type: utils.Mongo,
|
||||
Type: utils.MetaMongo,
|
||||
Host: "127.0.0.1",
|
||||
Port: "27017",
|
||||
Name: "10",
|
||||
|
||||
@@ -48,7 +48,7 @@ func TestDataDBCoverage(t *testing.T) {
|
||||
t.Errorf("Expected service to be running")
|
||||
}
|
||||
oldcfg := &config.DataDbCfg{
|
||||
Type: utils.Mongo,
|
||||
Type: utils.MetaMongo,
|
||||
Host: "127.0.0.1",
|
||||
Port: "27017",
|
||||
Name: "10",
|
||||
|
||||
@@ -94,15 +94,15 @@ func (db *StorDBService) Reload() (err error) {
|
||||
db.sync() // sync only if needed
|
||||
return
|
||||
}
|
||||
if db.cfg.StorDbCfg().Type == utils.Mongo {
|
||||
if db.cfg.StorDbCfg().Type == utils.MetaMongo {
|
||||
mgo, canCast := db.db.(*engine.MongoStorage)
|
||||
if !canCast {
|
||||
return fmt.Errorf("can't conver StorDB of type %s to MongoStorage",
|
||||
db.cfg.StorDbCfg().Type)
|
||||
}
|
||||
mgo.SetTTL(db.cfg.StorDbCfg().Opts.MongoQueryTimeout)
|
||||
} else if db.cfg.StorDbCfg().Type == utils.Postgres ||
|
||||
db.cfg.StorDbCfg().Type == utils.MySQL {
|
||||
} else if db.cfg.StorDbCfg().Type == utils.MetaPostgres ||
|
||||
db.cfg.StorDbCfg().Type == utils.MetaMySQL {
|
||||
msql, canCast := db.db.(*engine.SQLStorage)
|
||||
if !canCast {
|
||||
return fmt.Errorf("can't conver StorDB of type %s to SQLStorage",
|
||||
@@ -187,6 +187,6 @@ func (db *StorDBService) needsConnectionReload() bool {
|
||||
db.oldDBCfg.Password != db.cfg.StorDbCfg().Password {
|
||||
return true
|
||||
}
|
||||
return db.cfg.StorDbCfg().Type == utils.Postgres &&
|
||||
return db.cfg.StorDbCfg().Type == utils.MetaPostgres &&
|
||||
db.oldDBCfg.Opts.PgSSLMode != db.cfg.StorDbCfg().Opts.PgSSLMode
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user