modify redis
This commit is contained in:
@ -23,4 +23,5 @@ gpt35_model = "gpt35"
|
|||||||
mysql_conn = "localhost:3306"
|
mysql_conn = "localhost:3306"
|
||||||
mysql_user = "devops"
|
mysql_user = "devops"
|
||||||
mysql_pass = "b5hs945wXjHr"
|
mysql_pass = "b5hs945wXjHr"
|
||||||
redis_conn = "127.0.0.1:6379"
|
redis_conn = "127.0.0.1:6379"
|
||||||
|
redis_pass = "cK4dC3mN7"
|
||||||
@ -26,3 +26,4 @@ mysql_user = "root"
|
|||||||
mysql_pass = "mysqlpw"
|
mysql_pass = "mysqlpw"
|
||||||
#redis_conn = "172.18.0.4:6379"
|
#redis_conn = "172.18.0.4:6379"
|
||||||
redis_conn = "redis:6379"
|
redis_conn = "redis:6379"
|
||||||
|
redis_pass = "cK4dC3mN7"
|
||||||
|
|||||||
@ -31,6 +31,7 @@ type DataBaseConfig struct {
|
|||||||
// 在 Go 中,只有首字母大写的字段才能被外部包(如 viper)访问。
|
// 在 Go 中,只有首字母大写的字段才能被外部包(如 viper)访问。
|
||||||
MysqlConn string `mapstructure:"mysql_conn"`
|
MysqlConn string `mapstructure:"mysql_conn"`
|
||||||
RedisConn string `mapstructure:"redis_conn"`
|
RedisConn string `mapstructure:"redis_conn"`
|
||||||
|
RedisPass string `mapstructure:"redis_pass"`
|
||||||
MysqlUser string `mapstructure:"mysql_user"`
|
MysqlUser string `mapstructure:"mysql_user"`
|
||||||
MysqlPass string `mapstructure:"mysql_pass"`
|
MysqlPass string `mapstructure:"mysql_pass"`
|
||||||
}
|
}
|
||||||
|
|||||||
@ -53,7 +53,7 @@ func initDBManager(dbManager *DBManager, config *ConfigManager) error {
|
|||||||
// 初始化 Redis 连接
|
// 初始化 Redis 连接
|
||||||
rdb := redis.NewClient(&redis.Options{
|
rdb := redis.NewClient(&redis.Options{
|
||||||
Addr: config.GetDatabaseConfig().RedisConn,
|
Addr: config.GetDatabaseConfig().RedisConn,
|
||||||
Password: "", // no password set
|
Password: config.GetDatabaseConfig().RedisPass,
|
||||||
DB: 0, // use default DB
|
DB: 0, // use default DB
|
||||||
PoolSize: 10, // 连接池大小
|
PoolSize: 10, // 连接池大小
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user