1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 07:40:54 +00:00

remove mutex

This commit is contained in:
Pengfei Xue 2014-01-10 20:31:43 +08:00
parent b64e70e7df
commit cb55009c8b

6
cache/redis.go vendored
View File

@ -3,7 +3,6 @@ package cache
import ( import (
"encoding/json" "encoding/json"
"errors" "errors"
"sync"
"time" "time"
"github.com/beego/redigo/redis" "github.com/beego/redigo/redis"
@ -19,7 +18,6 @@ type RedisCache struct {
p *redis.Pool // redis connection pool p *redis.Pool // redis connection pool
conninfo string conninfo string
key string key string
mu sync.Mutex
} }
// create new redis cache with default collection name. // create new redis cache with default collection name.
@ -117,8 +115,6 @@ func (rc *RedisCache) StartAndGC(config string) error {
// connect to redis. // connect to redis.
func (rc *RedisCache) connectInit() { func (rc *RedisCache) connectInit() {
rc.mu.Lock()
// initialize a new pool // initialize a new pool
rc.p = &redis.Pool{ rc.p = &redis.Pool{
MaxIdle: 3, MaxIdle: 3,
@ -131,8 +127,6 @@ func (rc *RedisCache) connectInit() {
return c, nil return c, nil
}, },
} }
rc.mu.Unlock()
} }
func init() { func init() {