fix: 默认获取Redis实例时支持不指定数据源
This commit is contained in:
1 parent
72fc915481
commit
39bfe64828
1 file changed
+4
@@ -71,6 +71,10 @@ func DefaultRDB() *redis.Client {
|
|||||||
|
|
||||||
// 获取实例
|
// 获取实例
|
||||||
func RDB(source string) *redis.Client {
|
func RDB(source string) *redis.Client {
|
||||||
|
// 不指定时获取默认实例
|
||||||
|
if source == "" {
|
||||||
|
source = config.Get("redis.defaultDataSourceName").(string)
|
||||||
|
}
|
||||||
return rdbMap[source]
|
return rdbMap[source]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user