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

Commit 60cdc4b

Browse files
committed
Merge pull request #383 from smdcn/scdev
Memcached 驱动过期时间设置问题
2 parents 1b1ad4e + 8794f96 commit 60cdc4b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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)