-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
生成AccessToken时,似乎没有调用自定义缓存的delete方法 #693
Comments
删除是需要你自己实现的啊,不然过期时间有啥用? |
<?php
use Doctrine\Common\Cache\Cache as CacheInterface;
class MyCacheDriver implements CacheInterface
{
..............
.............
public function delete($id)
{
// 删除并返回 bool 值
} 这里的delete方法我已经重写了啊,业务逻辑就写了一条SQL 语句 DELETE FROM cache WHERE id=$id delete方法还需要写其他东西嘛? |
过期清除并不是 Doctrine Cache 这个组件去做的事情,redis, mc 这些都是自带过期清除功能的, mysql 没有过期时间的概念,所以需要定时执行脚本去删除过期的,明白么? |
好的,谢谢 $this->delete($id) |
可以啊,只要符合该机制就行了 |
谢谢安正超大神,我正在等待你设计的laravel文化衫到货,我close comment了 |
❤️ 加油! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
我用的环境
PHP 版本:5.6
overtrue/wechat 版本:3.1
问题及现象
我重写了一个mysql的DoctrineCache缓存,调整了过期时间后,读取缓存时,会重新生成很多token,而原有的token并没有被删除
The text was updated successfully, but these errors were encountered: