feat: config

This commit is contained in:
2024-10-26 16:26:10 +08:00
parent 5063f2f002
commit d15c03c04e
5 changed files with 90 additions and 0 deletions

View File

@@ -9,6 +9,8 @@ declare(strict_types=1);
* @contact group@hyperf.io
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/
use Hyperf\ModelCache\Handler\RedisHandler;
use function Hyperf\Support\env;
return [
@@ -37,5 +39,14 @@ return [
'inheritance' => 'Model',
],
],
'cache' => [
'handler' => RedisHandler::class,
'cache_key' => 'mc:%s:m:%s:%s:%s',
'prefix' => 'default',
'ttl' => 3600 * 24,
'empty_model_ttl' => 3600,
'load_script' => true,
'use_default_value' => false,
]
],
];