fix to TZRedis
Showing
1 changed file
with
4 additions
and
4 deletions
| ... | @@ -23,7 +23,7 @@ class TZRedis { | ... | @@ -23,7 +23,7 @@ class TZRedis { |
| 23 | } | 23 | } |
| 24 | } | 24 | } |
| 25 | 25 | ||
| 26 | static function set($key, $val, $expire = 60) { | 26 | static function set($key, $val, $expire = 300) { |
| 27 | try { | 27 | try { |
| 28 | 28 | ||
| 29 | self::connectInstance(); | 29 | self::connectInstance(); |
| ... | @@ -33,7 +33,7 @@ class TZRedis { | ... | @@ -33,7 +33,7 @@ class TZRedis { |
| 33 | } | 33 | } |
| 34 | 34 | ||
| 35 | }catch (Throwable $e) { | 35 | }catch (Throwable $e) { |
| 36 | error_log(self::$err."Failed to set ".$key." with ".$val); | 36 | error_log(self::$err."Failed to set ".$key." with ".$val. ", error message = ".$e->getMessage()); |
| 37 | } | 37 | } |
| 38 | } | 38 | } |
| 39 | 39 | ||
| ... | @@ -44,7 +44,7 @@ class TZRedis { | ... | @@ -44,7 +44,7 @@ class TZRedis { |
| 44 | 44 | ||
| 45 | if(self::$redis) { | 45 | if(self::$redis) { |
| 46 | if($unserialize) { | 46 | if($unserialize) { |
| 47 | unserialize(self::$redis->get($key)); | 47 | return unserialize(self::$redis->get($key)); |
| 48 | } else { | 48 | } else { |
| 49 | return self::$redis->get($key); | 49 | return self::$redis->get($key); |
| 50 | } | 50 | } |
| ... | @@ -75,7 +75,7 @@ class TZRedis { | ... | @@ -75,7 +75,7 @@ class TZRedis { |
| 75 | self::connectInstance(); | 75 | self::connectInstance(); |
| 76 | 76 | ||
| 77 | if(self::$redis) { | 77 | if(self::$redis) { |
| 78 | return self::$redis->delete($key); | 78 | self::$redis->delete($key); |
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | }catch (Throwable $e) { | 81 | }catch (Throwable $e) { | ... | ... |
-
Please register or sign in to post a comment