From cb55009c8be136d3aa427f53f9408b45669736d4 Mon Sep 17 00:00:00 2001 From: Pengfei Xue Date: Fri, 10 Jan 2014 20:31:43 +0800 Subject: [PATCH] remove mutex --- cache/redis.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/cache/redis.go b/cache/redis.go index 90047b6f..ba1d4d49 100644 --- a/cache/redis.go +++ b/cache/redis.go @@ -3,7 +3,6 @@ package cache import ( "encoding/json" "errors" - "sync" "time" "github.com/beego/redigo/redis" @@ -19,7 +18,6 @@ type RedisCache struct { p *redis.Pool // redis connection pool conninfo string key string - mu sync.Mutex } // create new redis cache with default collection name. @@ -117,8 +115,6 @@ func (rc *RedisCache) StartAndGC(config string) error { // connect to redis. func (rc *RedisCache) connectInit() { - rc.mu.Lock() - // initialize a new pool rc.p = &redis.Pool{ MaxIdle: 3, @@ -131,8 +127,6 @@ func (rc *RedisCache) connectInit() { return c, nil }, } - - rc.mu.Unlock() } func init() {