diff --git a/ThinkPHP/Library/Think/Cache/Driver/Memcached.class.php b/ThinkPHP/Library/Think/Cache/Driver/Memcached.class.php index 5cf08faf1..82b38a5dd 100644 --- a/ThinkPHP/Library/Think/Cache/Driver/Memcached.class.php +++ b/ThinkPHP/Library/Think/Cache/Driver/Memcached.class.php @@ -72,7 +72,8 @@ public function set($name, $value, $expire = null) $expire = $this->options['expire']; } $name = $this->options['prefix'] . $name; - if ($this->handler->set($name, $value, time() + $expire)) { + $expire = $expire == 0 ? 0 : time() + $expire; + if ($this->handler->set($name, $value, $expire)) { if ($this->options['length'] > 0) { // 记录缓存队列 $this->queue($name);