|
@@ -106,7 +106,7 @@ class CacheRedis extends Cache
|
|
|
|
|
|
public function get_org($key,$prefix = '')
|
|
|
{
|
|
|
- $this->init_master();
|
|
|
+ $this->init_slave();
|
|
|
if (!$this->enable) return false;
|
|
|
$this->type = $prefix;
|
|
|
$result = $this->handler->get($this->_key($key));
|
|
@@ -240,6 +240,7 @@ class CacheRedis extends Cache
|
|
|
}
|
|
|
|
|
|
public function hIncrByFloat($name, $prefix, $key, $num = 1) {
|
|
|
+ $this->init_master();
|
|
|
if ($this->hget($name, $prefix,$key) !== false) {
|
|
|
$this->handler->hIncrByFloat($this->_key($name), $key, floatval($num));
|
|
|
}
|
|
@@ -262,13 +263,12 @@ class CacheRedis extends Cache
|
|
|
return $this->prefix.$this->type.$str;
|
|
|
}
|
|
|
|
|
|
- public function keys($key = '') {
|
|
|
- $this->init_master();
|
|
|
-
|
|
|
+ public function keys($key = '')
|
|
|
+ {
|
|
|
+ $this->init_slave();
|
|
|
if(!isset($key) || empty($key)) {
|
|
|
$key = '*';
|
|
|
}
|
|
|
-
|
|
|
return $this->handler->keys($this->_key($key));
|
|
|
}
|
|
|
|
|
@@ -279,7 +279,7 @@ class CacheRedis extends Cache
|
|
|
}
|
|
|
|
|
|
public function lLen($key) {
|
|
|
- $this->init_master();
|
|
|
+ $this->init_slave();
|
|
|
if (!$this->enable) return false;
|
|
|
return $this->handler->lLen($key);
|
|
|
}
|