菜单和部分接口返回对语言进行适配
This commit is contained in:
28
config/game_hot_cache.php
Normal file
28
config/game_hot_cache.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* 游戏侧热点数据 Redis 缓存(用户 / game_config / game_record)
|
||||
*
|
||||
* 环境变量见 .env-example 中 GAME_HOT_CACHE_*
|
||||
*/
|
||||
$envInt = static function (string $key, int $default): int {
|
||||
$raw = env($key, null);
|
||||
if ($raw === null || $raw === '') {
|
||||
return $default;
|
||||
}
|
||||
$n = filter_var($raw, FILTER_VALIDATE_INT);
|
||||
|
||||
return ($n === false || $n < 1) ? $default : $n;
|
||||
};
|
||||
|
||||
return [
|
||||
'enabled' => filter_var(env('GAME_HOT_CACHE_ENABLED', true), FILTER_VALIDATE_BOOLEAN),
|
||||
/** game_config 行缓存(秒),后台修改会主动删除 */
|
||||
'ttl_game_config' => $envInt('GAME_HOT_CACHE_TTL_GAME_CONFIG', 86400),
|
||||
/** game_record 行缓存(秒) */
|
||||
'ttl_game_record' => $envInt('GAME_HOT_CACHE_TTL_GAME_RECORD', 60),
|
||||
/** user 行缓存(秒),余额/连胜变更会主动删除 */
|
||||
'ttl_user' => $envInt('GAME_HOT_CACHE_TTL_USER', 90),
|
||||
];
|
||||
Reference in New Issue
Block a user