jeristiano

Results 8 comments of jeristiano

在协程请求结束后,手动释放掉缓存,这个方案可行吗? ```php public function process(object $event) { Str::macro('cacheFlush', function () { self::$snakeCache=[]; self::$camelCache=[]; self::$studlyCache=[]; }); } ``` ```php private function deferCollectGarbage(){ defer(function(){ Str::cacheFlush(); }); } ```

`\bandwidthThrottle\tokenBucket\storage\StorageException` ``` string(3689) "#0 /var/www/code/customers/vendor/hyperf/rate-limit/src/Aspect/RateLimitAnnotationAspect.php(87): bandwidthThrottle\tokenBucket\TokenBucket->consume() #1 /var/www/code/customers/vendor/hyperf/di/src/Aop/Pipeline.php(30): Hyperf\RateLimit\Aspect\RateLimitAnnotationAspect->process() #2 /var/www/code/customers/vendor/hyperf/di/src/Aop/ProceedingJoinPoint.php(69): Hyperf\Di\Aop\Pipeline->Hyperf\Di\Aop\{closure}() #3 /var/www/code/customers/app/Aspect/ControllerRoundAspect.php(50): Hyperf\Di\Aop\ProceedingJoinPoint->process() #4 /var/www/code/customers/vendor/hyperf/di/src/Aop/Pipeline.php(30): App\Aspect\ControllerRoundAspect->process() #5 /var/www/code/customers/vendor/hyperf/utils/src/Pipeline.php(95): Hyperf\Di\Aop\Pipeline->Hyperf\Di\Aop\{closure}() #6 /var/www/code/customers/vendor/hyperf/di/src/Aop/ProxyTrait.php(86): Hyperf\Utils\Pipeline->then() #7 /var/www/code/customers/vendor/hyperf/di/src/Aop/ProxyTrait.php(29): App\Controller\IndexController::handleAround() #8 /var/www/code/customers/runtime/container/proxy/App_Controller_IndexController.proxy.php(52): App\Controller\IndexController::__proxyCall()...

我使用3.0版本测试了,没有问题, 2.2版本存在这个问题

我新下载了一个 2.2的纯净版项目同样没有复现这个问题. 于是我的思路是将项目组件一个一个的卸载直到纯净版为止,同样卸载到纯净版后就可以使用了。 接下來重新安装组件,在 `hyperf/watcher` 在安装以前仍然可以使用,继续尝试安装 `hyperf/watcher` , 果然安装完就不能使用了, 我再次卸载 `hyperf/watcher` 组件,仍然不能使用。 因此可以推測也不是 `hyperf/watcher` 导致的。 最後我发现了我项目的问题: **组件的安装顺序** ``` "require": { "php": ">=7.4", "hyperf/rate-limit": "^2.2", "hyperf/redis": "~2.2.0", "doctrine/dbal": "^3.0", "ext-bcmath": "*",...

这个问题可能是你开启了多个swoole task worker 导致的,应该先确保 server.php 内 `Constant::OPTION_WORKER_NUM => 1`

> > > 我的解决了,写了篇文章,可以看一下是否有没注意的步骤;https://learnku.com/articles/64503 > > 看了你的文章 ,还是一样的额报错, server.php Constant::OPTION_WORKER_NUM => 1,设置也没用 > > > `[yasd] recv command error, connection closed > > [yasd] recv command error, connection closed >...

> 这么神奇吗,还跟组件先后顺序有关系,这个问题修复了吗 应该是没有,没人注意到这个问题