Skip to content
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

Manager能不能增加一个清空驱动的方法? #2823

Open
augushong opened this issue Feb 3, 2023 · 0 comments
Open

Manager能不能增加一个清空驱动的方法? #2823

augushong opened this issue Feb 3, 2023 · 0 comments

Comments

@augushong
Copy link

think\Manager能否增加清空所有driver的方法,目前的Cache::forgetDriver();只能清空一个或指定驱动,有时候希望清空所有的已存在的驱动,以便重新加载驱动。

具体场景是,当在TP框架中,使用workerman多进程时,在开启多进程之前,就实例化了驱动,比如redis的驱动,开启多进程之后,将导致多个进程的redis连接出现并发问题。这个问题是确实存在的:比如https://www.workerman.net/q/7737

可以主动清空驱动:

图片

我想问的是,能不能做一个清空所有驱动的方法,比如forgetAllDriver,

另一个问题是,App有没有能力做一个清空所有驱动的方法,比如App::resetAllDriver,将所有的驱动,包括cache、db等,全部都清空。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant