Skip to content
This repository was archived by the owner on Jan 4, 2020. It is now read-only.

Commit 8794f96

Browse files
committed
Memcached 驱动过期时间设置问题
1 parent 9b5b4e0 commit 8794f96

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

ThinkPHP/Library/Think/Cache/Driver/Memcached.class.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ public function set($name, $value, $expire = null)
7272
$expire = $this->options['expire'];
7373
}
7474
$name = $this->options['prefix'] . $name;
75-
if ($this->handler->set($name, $value, time() + $expire)) {
75+
$expire = $expire == 0 ? 0 : time() + $expire;
76+
if ($this->handler->set($name, $value, $expire)) {
7677
if ($this->options['length'] > 0) {
7778
// 记录缓存队列
7879
$this->queue($name);

0 commit comments

Comments
 (0)