|
@@ -59,7 +59,8 @@ class Redis implements Intf
|
|
|
try {
|
|
|
$res = $this->redis->hMset($id, $data);
|
|
|
if (isset($this->policy['life_time']) && $this->policy['life_time'] > 0) {
|
|
|
- $this->redis->setTimeout($id, $this->policy['life_time']);
|
|
|
+ //$this->redis->setTimeout($id, $this->policy['life_time']);
|
|
|
+ $this->redis->expire($id, $this->policy['life_time']);
|
|
|
}
|
|
|
} catch (\CredisException $e) {
|
|
|
throw new \Qii\Exceptions\Errors(\Qii::i(-1, $e->getMessage()), __LINE__);
|
|
@@ -79,7 +80,8 @@ class Redis implements Intf
|
|
|
try {
|
|
|
$res = $this->redis->set($id, $value);
|
|
|
if (isset($this->policy['life_time']) && $this->policy['life_time'] > 0) {
|
|
|
- $this->redis->setTimeout($id, $this->policy['life_time']);
|
|
|
+ //$this->redis->setTimeout($id, $this->policy['life_time']);
|
|
|
+ $this->redis->expire($id, $this->policy['life_time']);
|
|
|
}
|
|
|
} catch (\CredisException $e) {
|
|
|
throw new \Qii\Exceptions\Errors(\Qii::i(-1, $e->getMessage()), __LINE__);
|