Don't generate rpc proxy again when open scan cacheable. (#5005)

This commit is contained in:
李铭昕 2022-08-10 20:58:39 +08:00 committed by GitHub
parent bbd134cacd
commit 035b830cbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -3,6 +3,7 @@
## Optimized
- [#5002](https://github.com/hyperf/hyperf/pull/5002) Optimized the generation rules of rpc proxy class suffix, which can be customized more easily.
- [#5005](https://github.com/hyperf/hyperf/pull/5005) Don't generate rpc proxy again when open `scan cacheable`.
# v2.2.34 - 2022-07-21

View File

@ -11,6 +11,7 @@ declare(strict_types=1);
*/
namespace Hyperf\RpcClient;
use Hyperf\Di\Annotation\ScanConfig;
use Hyperf\RpcClient\Proxy\Ast;
use Hyperf\RpcClient\Proxy\CodeLoader;
use Hyperf\Utils\Coroutine\Locker;
@ -77,6 +78,10 @@ class ProxyFactory
return true;
}
if (ScanConfig::instance('')->isCacheable()) {
return false;
}
$time = $this->filesystem->lastModified(
$this->codeLoader->getPathByClassName($interface)
);