This commit is contained in:
@@ -34,6 +34,8 @@ class ThemeConfigModel
|
||||
*/
|
||||
public function getConfig(): array
|
||||
{
|
||||
// 临时禁用缓存读取用于调试
|
||||
/*
|
||||
// 尝试从缓存获取
|
||||
try {
|
||||
$config = Cache::get(self::CACHE_KEY);
|
||||
@@ -45,6 +47,7 @@ class ThemeConfigModel
|
||||
} catch (\Throwable $e) {
|
||||
// 缓存系统异常,继续从数据库读取
|
||||
}
|
||||
*/
|
||||
|
||||
// 缓存未命中,从数据库读取
|
||||
$row = $this->query()->order('id', 'asc')->find();
|
||||
@@ -55,12 +58,15 @@ class ThemeConfigModel
|
||||
$config = is_array($config) ? $config : $this->defaultConfig();
|
||||
}
|
||||
|
||||
// 临时禁用缓存写入用于调试
|
||||
/*
|
||||
// 写入缓存 (忽略缓存写入失败)
|
||||
try {
|
||||
Cache::set(self::CACHE_KEY, $config, self::CACHE_TTL);
|
||||
} catch (\Throwable $e) {
|
||||
// 忽略缓存写入失败
|
||||
}
|
||||
*/
|
||||
|
||||
return $config;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user