Commit ca9fa80e by huangchengyi

Merge branch 'dev' of http://119.23.72.7/mushishixian/search_server into dev

parents 3be929a2 2324582b
Showing with 7 additions and 5 deletions
......@@ -12,18 +12,20 @@ type ichuntRedis struct {
RedisList map[string]*redis.Pool
}
func(this *ichuntRedis) Conn(connection string) (*redis.Pool){
return this.RedisList[connection]
var ichuntRedis_ = &ichuntRedis{}
func Conn(connection string) (*redis.Pool){
return ichuntRedis_.RedisList[connection]
}
var writeConn, readConn *redis.Pool
func Setup() (err error) {
ichuntRedis := &ichuntRedis{}
ichuntRedis.RedisList = make(map[string]*redis.Pool,0)
ichuntRedis_.RedisList = make(map[string]*redis.Pool,0)
RedisDatabaseMap := config.BuildRedisConfgs()
for redisKey,redisConfig := range RedisDatabaseMap{
ichuntRedis.RedisList[redisKey],err = getConn(redisConfig.Host, redisConfig.Password)
ichuntRedis_.RedisList[redisKey],err = getConn(redisConfig.Host, redisConfig.Password)
if err != nil{
panic(err)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment