-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Labels
Description
所属功能组件
缓存(Cache)
ThinkPHP 版本
6.0
操作系统
Ubuntu
错误信息
cache.php配置如下
return [
'default' => 'redis',
'stores' => [
// 文件缓存
'file' => [
// 驱动方式
'type' => 'file',
// 设置不同的缓存保存目录
'path' => '../runtime/file/',
],
// redis缓存
'redis' => [
// 驱动方式
'type' => 'redis',
// 服务器地址
'host' => 'xxx',
'port' => '6379',
'password' => '',
'select' => 1,
'persistent' => true,
'prefix' => '',
'serialize' => true,
],
'test00' => [
'type' => 'redis',
'host' => 'xxx',
'port' => 6379,
'password' => '',
'select' => 0,
'timeout' => 0,
'expire' => 0,
'persistent' => true,
'prefix' => '',
'serialize' => true,
]
],
];控制器代码如下:
public function test()
{
\think\facade\Cache::store('test00')->set('test00', 'test00');
return 'success';
}执行控制器代码,此时test00这个key写在了1号库没有按照配置写入0号库
另外修改配置,将persistent都改成false这时候正常写入,又或者将源码中的if判断注释,强制进行select,,则能正常读写

其它说明
No response
augushong