Отныне мы не используем пул соединений для редиса (Revert, прогнал тесты, убедился, что только хуже)

This reverts commit 915c465224.
This commit is contained in:
ErickSkrauch
2016-07-07 23:41:21 +03:00
parent 915c465224
commit 283f4e0e3f
3 changed files with 7 additions and 7 deletions

View File

@@ -20,12 +20,12 @@ type SkinItem struct {
func (s *SkinItem) Save() {
str, _ := json.Marshal(s)
services.RedisPool.Cmd("SET", tools.BuildKey(s.Nickname), str)
services.Redis.Cmd("SET", tools.BuildKey(s.Nickname), str)
}
func FindRecord(username string) (SkinItem, error) {
var record SkinItem;
result, err := services.RedisPool.Cmd("GET", tools.BuildKey(username)).Str();
result, err := services.Redis.Cmd("GET", tools.BuildKey(username)).Str();
if (err == nil) {
decodeErr := json.Unmarshal([]byte(result), &record)
if (decodeErr != nil) {

View File

@@ -1,10 +1,10 @@
package services
import (
"github.com/mediocregopher/radix.v2/pool"
"github.com/mediocregopher/radix.v2/redis"
"github.com/gorilla/mux"
)
var RedisPool *pool.Pool
var Redis *redis.Client
var Router *mux.Router