|
@@ -48,7 +48,7 @@ func RedisSet(code, key string, val interface{}, timeout int) bool {
|
|
|
defer util.Catch()
|
|
|
client := redisClientMap[code]
|
|
|
if client == nil {
|
|
|
- fmt.Println("Redis Not Init")
|
|
|
+ fmt.Println("Redis Not Init Set")
|
|
|
return false
|
|
|
}
|
|
|
//err := client.Set(context.Background(), key, val, time.Duration(timeout)*time.Second).Err()
|
|
@@ -66,7 +66,7 @@ func RedisExist(code, key string) bool {
|
|
|
defer util.Catch()
|
|
|
client := redisClientMap[code]
|
|
|
if client == nil {
|
|
|
- fmt.Println("Redis Not Init")
|
|
|
+ fmt.Println("Redis Not Init Exist")
|
|
|
return false
|
|
|
}
|
|
|
result, err := client.Exists(context.Background(), key).Result()
|
|
@@ -81,12 +81,12 @@ func RedisGet(code, key string) (string, error) {
|
|
|
defer util.Catch()
|
|
|
client := redisClientMap[code]
|
|
|
if client == nil {
|
|
|
- fmt.Println("Redis Not Init")
|
|
|
+ fmt.Println("Redis Not Init Get")
|
|
|
return "", errors.New("Redis Not Init")
|
|
|
}
|
|
|
result, err := client.Get(context.Background(), key).Result()
|
|
|
if err != nil {
|
|
|
- fmt.Println("Get Redis Error:", err, result)
|
|
|
+ //fmt.Println("Get Redis Error:", err, result)
|
|
|
return "", err
|
|
|
}
|
|
|
return result, err
|