延迟更新方法改进 避免受缓存时间设置影响

This commit is contained in:
thinkphp
2015-12-29 15:54:43 +08:00
parent fa8f09c9af
commit 321230e3e3

View File

@@ -720,14 +720,14 @@ class Model
return $value + $step; return $value + $step;
} else { } else {
// 追加数据到缓存 // 追加数据到缓存
Cache::set($guid, $value + $step); Cache::set($guid, $value + $step, 0);
return false; return false;
} }
} else { } else {
// 没有缓存数据 // 没有缓存数据
Cache::set($guid, $step); Cache::set($guid, $step, 0);
// 计时开始 // 计时开始
Cache::set($guid . '_time', NOW_TIME); Cache::set($guid . '_time', NOW_TIME, 0);
return false; return false;
} }
} }